Skip to content

Commit 6e17f58

Browse files
Dan Carpenteramschuma-ntap
authored andcommitted
xprtrdma: Double free in rpcrdma_sendctxs_create()
The clean up is handled by the caller, rpcrdma_buffer_create(), so this call to rpcrdma_sendctxs_destroy() leads to a double free. Fixes: ae72950 ("xprtrdma: Add data structure to manage RDMA Send arguments") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 4429b66 commit 6e17f58

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

net/sunrpc/xprtrdma/verbs.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -845,17 +845,13 @@ static int rpcrdma_sendctxs_create(struct rpcrdma_xprt *r_xprt)
845845
for (i = 0; i <= buf->rb_sc_last; i++) {
846846
sc = rpcrdma_sendctx_create(&r_xprt->rx_ia);
847847
if (!sc)
848-
goto out_destroy;
848+
return -ENOMEM;
849849

850850
sc->sc_xprt = r_xprt;
851851
buf->rb_sc_ctxs[i] = sc;
852852
}
853853

854854
return 0;
855-
856-
out_destroy:
857-
rpcrdma_sendctxs_destroy(buf);
858-
return -ENOMEM;
859855
}
860856

861857
/* The sendctx queue is not guaranteed to have a size that is a

0 commit comments

Comments
 (0)