]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
smb/server: call ksmbd_session_rpc_close() on error path in create_smb2_pipe()
authorZhangGuoDong <zhangguodong@kylinos.cn>
Sun, 28 Dec 2025 14:51:01 +0000 (22:51 +0800)
committerSteve French <stfrench@microsoft.com>
Mon, 29 Dec 2025 23:39:57 +0000 (17:39 -0600)
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>
fs/smb/server/smb2pdu.c

index a607e072a37012fc52674cbb86174290ffcab352..8a7c48adb87e6c93903702f7775e6f18f5e217c2 100644 (file)
@@ -2281,7 +2281,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;
 
@@ -2338,6 +2338,9 @@ out:
                break;
        }
 
+       if (id >= 0)
+               ksmbd_session_rpc_close(work->sess, id);
+
        if (!IS_ERR(name))
                kfree(name);