summaryrefslogtreecommitdiff
path: root/fs/smb/server/smb2pdu.c
diff options
context:
space:
mode:
authorZhangGuoDong <zhangguodong@kylinos.cn>2025-12-28 22:51:01 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-02-11 13:41:47 +0100
commitfdda836fcee6fdbcccc24e3679097efb583f581f (patch)
tree6315f90086168f3f1688af056fc2e793d97ee546 /fs/smb/server/smb2pdu.c
parentf309b2c7df659ecd3e6861304352ae405abaa307 (diff)
smb/server: call ksmbd_session_rpc_close() on error path in create_smb2_pipe()
[ Upstream commit 7c28f8eef5ac5312794d8a52918076dcd787e53b ] When ksmbd_iov_pin_rsp() fails, we should call ksmbd_session_rpc_close(). Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/smb/server/smb2pdu.c')
-rw-r--r--fs/smb/server/smb2pdu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 2b59c282cda5..10d58e309442 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -2291,7 +2291,7 @@ static noinline int create_smb2_pipe(struct ksmbd_work *work)
{
struct smb2_create_rsp *rsp;
struct smb2_create_req *req;
- int id;
+ int id = -1;
int err;
char *name;
@@ -2348,6 +2348,9 @@ out:
break;
}
+ if (id >= 0)
+ ksmbd_session_rpc_close(work->sess, id);
+
if (!IS_ERR(name))
kfree(name);