svcrdma: Fix double svc_rdma_send_ctxt_put() in an error path
authorChuck Lever <chuck.lever@oracle.com>
Mon, 2 Mar 2020 20:00:14 +0000 (15:00 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 16 Mar 2020 16:04:31 +0000 (12:04 -0400)
This error path is almost never executed. Found by code inspection.

Fixes: 99722fe4d5a6 ("svcrdma: Persistently allocate and DMA-map Send buffers")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/xprtrdma/svc_rdma_sendto.c

index a11983c2056f35a8d754977036bb87430a3e668b..354c5619176a349b9525a04df37f323c75c20b0c 100644 (file)
@@ -786,7 +786,6 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma,
                                   struct svc_rqst *rqstp)
 {
        __be32 *p;
-       int ret;
 
        p = ctxt->sc_xprt_buf;
        trace_svcrdma_err_chunk(*p);
@@ -798,13 +797,7 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma,
        svc_rdma_save_io_pages(rqstp, ctxt);
 
        ctxt->sc_send_wr.opcode = IB_WR_SEND;
-       ret = svc_rdma_send(rdma, &ctxt->sc_send_wr);
-       if (ret) {
-               svc_rdma_send_ctxt_put(rdma, ctxt);
-               return ret;
-       }
-
-       return 0;
+       return svc_rdma_send(rdma, &ctxt->sc_send_wr);
 }
 
 /**