summaryrefslogtreecommitdiff
path: root/net/sunrpc
diff options
context:
space:
mode:
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>2022-11-20 10:34:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-14 12:15:38 +0300
commitbe7d90fc3a8f59adf7f9440ec4451fe8c1f13d7c (patch)
treee2962cd4506fe6c8f8e7d6a702120dc366a809b4 /net/sunrpc
parent0649129359219ce6ff380ec401f87308485c6ae3 (diff)
downloadlinux-be7d90fc3a8f59adf7f9440ec4451fe8c1f13d7c.tar.xz
xprtrdma: Fix regbuf data not freed in rpcrdma_req_create()
[ Upstream commit 9181f40fb2952fd59ecb75e7158620c9c669eee3 ] If rdma receive buffer allocate failed, should call rpcrdma_regbuf_free() to free the send buffer, otherwise, the buffer data will be leaked. Fixes: bb93a1ae2bf4 ("xprtrdma: Allocate req's regbufs at xprt create time") Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/xprtrdma/verbs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index dcc1992b14d7..338b06de86d1 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -866,7 +866,7 @@ struct rpcrdma_req *rpcrdma_req_create(struct rpcrdma_xprt *r_xprt, size_t size,
return req;
out3:
- kfree(req->rl_sendbuf);
+ rpcrdma_regbuf_free(req->rl_sendbuf);
out2:
kfree(req);
out1: