Skip to content

Commit

Permalink
svcrdma: Free context on post_recv error in send_reply
Browse files Browse the repository at this point in the history
If an error is encountered trying to post a recv buffer in send_reply,
free the passed in context. Return an error to the caller so it is
aware that the request was not posted.

Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
  • Loading branch information
Tom Tucker committed May 19, 2008
1 parent 05a0826 commit 5ac461a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/sunrpc/xprtrdma/svc_rdma_sendto.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ static int send_reply(struct svcxprt_rdma *rdma,
"svcrdma: could not post a receive buffer, err=%d."
"Closing transport %p.\n", ret, rdma);
set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags);
return 0;
svc_rdma_put_context(ctxt, 0);
return -ENOTCONN;
}

/* Prepare the context */
Expand Down

0 comments on commit 5ac461a

Please sign in to comment.