Skip to content

Commit 7c28f8e

Browse files
ZhangGuoDongsmfrench
authored andcommitted
smb/server: call ksmbd_session_rpc_close() on error path in create_smb2_pipe()
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>
1 parent 0c56693 commit 7c28f8e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

fs/smb/server/smb2pdu.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,7 @@ static noinline int create_smb2_pipe(struct ksmbd_work *work)
22812281
{
22822282
struct smb2_create_rsp *rsp;
22832283
struct smb2_create_req *req;
2284-
int id;
2284+
int id = -1;
22852285
int err;
22862286
char *name;
22872287

@@ -2338,6 +2338,9 @@ static noinline int create_smb2_pipe(struct ksmbd_work *work)
23382338
break;
23392339
}
23402340

2341+
if (id >= 0)
2342+
ksmbd_session_rpc_close(work->sess, id);
2343+
23412344
if (!IS_ERR(name))
23422345
kfree(name);
23432346

0 commit comments

Comments
 (0)