From: Zhang Xiaoxu Date: Sun, 20 Nov 2022 07:34:29 +0000 (+0800) Subject: xprtrdma: Fix regbuf data not freed in rpcrdma_req_create() X-Git-Tag: baikal/aarch64/sdk5.9~632 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=5eba16b3b9804971c061f72d7375f336c3131a56;p=kernel.git 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: 1e349d78e5b6 ("xprtrdma: Allocate req's regbufs at xprt create time") Signed-off-by: Zhang Xiaoxu Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index 0f4d39fdb48f2..e13115bbe7196 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c @@ -1037,6 +1037,7 @@ out4: kfree(req->rl_sendbuf); out3: kfree(req->rl_rdmabuf); + rpcrdma_regbuf_free(req->rl_sendbuf); out2: kfree(req); out1: