From: Andy Grover Date: Thu, 28 Oct 2010 15:40:57 +0000 (+0000) Subject: RDS: Clean up error handling in rds_cmsg_rdma_args X-Git-Tag: v2.6.37-rc1~11^2~6 X-Git-Url: http://bbs.cooldavid.org/git/?p=net-next-2.6.git;a=commitdiff_plain;h=f4a3fc03c1d73753879fb655b8cd628b29f6706b RDS: Clean up error handling in rds_cmsg_rdma_args We don't need to set ret = 0 at the end -- it's initialized to 0. Also, don't increment s_send_rdma stat if we're exiting with an error. Signed-off-by: Andy Grover Signed-off-by: David S. Miller --- diff --git a/net/rds/rdma.c b/net/rds/rdma.c index d0ba2ca3b71..334acdd32ab 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c @@ -664,13 +664,12 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm, } op->op_bytes = nr_bytes; - ret = 0; out: kfree(pages); if (ret) rds_rdma_free_op(op); - - rds_stats_inc(s_send_rdma); + else + rds_stats_inc(s_send_rdma); return ret; }