ksmbd: Fix resource leak in ksmbd_session_rpc_open()
authorXiu Jianfeng <xiujianfeng@huawei.com>
Wed, 16 Nov 2022 12:22:37 +0000 (20:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:42 +0000 (13:32 +0100)
commitf9ed133381eba883c5e0059063d5b3ca7cac6d41
treef81aa5f8405a8555cfe3c26ebd6a3dd802fb3d16
parent7f09fe9fc6ea1e299cd3520ceec598fc6c6500ce
ksmbd: Fix resource leak in ksmbd_session_rpc_open()

[ Upstream commit bc044414fa0326a4e5c3c509c00b1fcaf621b5f4 ]

When ksmbd_rpc_open() fails then it must call ksmbd_rpc_id_free() to
undo the result of ksmbd_ipc_id_alloc().

Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ksmbd/mgmt/user_session.c