Skip to content

Commit 9181f40

Browse files
z00467499Trond Myklebust
authored andcommitted
xprtrdma: Fix regbuf data not freed in rpcrdma_req_create()
If rdma receive buffer allocate failed, should call rpcrdma_regbuf_free() to free the send buffer, otherwise, the buffer data will be leaked. Fixes: bb93a1a ("xprtrdma: Allocate req's regbufs at xprt create time") Signed-off-by: Zhang Xiaoxu <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent ef8d98f commit 9181f40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sunrpc/xprtrdma/verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ struct rpcrdma_req *rpcrdma_req_create(struct rpcrdma_xprt *r_xprt,
831831
return req;
832832

833833
out3:
834-
kfree(req->rl_sendbuf);
834+
rpcrdma_regbuf_free(req->rl_sendbuf);
835835
out2:
836836
kfree(req);
837837
out1:

0 commit comments

Comments
 (0)