From: Tom Tucker Date: Fri, 25 Apr 2008 19:11:31 +0000 (-0500) Subject: svcrdma: Free context on ib_post_recv error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=05a0826a6e6d95ab6e9c3e4a10b58e10f233cc2b;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git svcrdma: Free context on ib_post_recv error If there is an error posting the recv WR to the RQ, free the context associated with the WR. This would leak a context when asynchronous errors occurred on the transport while conccurent threads were processing their RPC. Signed-off-by: Tom Tucker --- diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 4bf8b5ad167..e85ac77f495 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -524,6 +524,8 @@ int svc_rdma_post_recv(struct svcxprt_rdma *xprt) recv_wr.wr_id = (u64)(unsigned long)ctxt; ret = ib_post_recv(xprt->sc_qp, &recv_wr, &bad_recv_wr); + if (ret) + svc_rdma_put_context(ctxt, 1); return ret; }