Skip to content
Commit a7e6477c authored by Zizhi Wo's avatar Zizhi Wo Committed by Greg Kroah-Hartman
Browse files

ksmbd: fix memory leak in smb2_lock()

[ Upstream commit 8f175272 ]

In smb2_lock(), if setup_async_work() executes successfully,
work->cancel_argv will bind the argv that generated by kmalloc(). And
release_async_work() is called in ksmbd_conn_try_dequeue_request() or
smb2_lock() to release argv.
However, when setup_async_work function fails, work->cancel_argv has not
been bound to the argv, resulting in the previously allocated argv not
being released. Call kfree() to fix it.

Fixes: e2f34481

 ("cifsd: add server-side procedures for SMB3")
Signed-off-by: default avatarZizhi Wo <wozizhi@huawei.com>
Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 8925ab33
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment