diff mbox

[3/5] RDS: Clean up error handling in rds_cmsg_rdma_args

Message ID 1288316459-4679-4-git-send-email-andy.grover@oracle.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Andy Grover Oct. 29, 2010, 1:40 a.m. UTC
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 <andy.grover@oracle.com>
---
 net/rds/rdma.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/net/rds/rdma.c b/net/rds/rdma.c
index d0ba2ca..334acdd 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;
 }