Skip to content

Commit

Permalink
RDS: Clean up error handling in rds_cmsg_rdma_args
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Andy Grover authored and davem330 committed Oct 30, 2010
1 parent a09f69c commit f4a3fc0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/rds/rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f4a3fc0

Please sign in to comment.