From: Tom Tucker Date: Fri, 25 Apr 2008 23:08:59 +0000 (-0500) Subject: svcrdma: Free context on post_recv error in send_reply X-Git-Tag: v2.6.26-rc4~90^2^2~15 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=5ac461a6f05499fa233ea43b1de80b679d1eec21;p=linux-2.6-omap-h63xx.git svcrdma: Free context on post_recv error in send_reply 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 --- diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index f61d7bd105f..fb82b1b683f 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -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 */