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:14:31 +0000 (13:14 +0100)
commit31c1b5d3000cdff70b98d5af045271e09079bec1
tree6fa8685d1ef5e11e50ed5f33035812e8aa08efa2
parenta44102d36a7a23c909e2d2c7dc1574c059ff78e1
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