svcrdma: Free context on post_recv error in send_reply
authorTom Tucker <tom@opengridcomputing.com>
Fri, 25 Apr 2008 23:08:59 +0000 (18:08 -0500)
committerTom Tucker <tom@opengridcomputing.com>
Mon, 19 May 2008 12:33:47 +0000 (07:33 -0500)
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>
net/sunrpc/xprtrdma/svc_rdma_sendto.c

index f61d7bd105fb9a71dbba8b662d2dfa5bd8b6ec9c..fb82b1b683f898ef3e305fd232202e693e396651 100644 (file)
@@ -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 */