mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 12:00:22 +09:00
ksmbd: fix passing freed memory 'aux_payload_buf'
[ Upstream commit59d8d24f46] The patche2b76ab8b5: "ksmbd: add support for read compound" leads to the following Smatch static checker warning: fs/smb/server/smb2pdu.c:6329 smb2_read() warn: passing freed memory 'aux_payload_buf' It doesn't matter that we're passing a freed variable because nbytes is zero. This patch set "aux_payload_buf = NULL" to make smatch silence. Fixes:e2b76ab8b5("ksmbd: add support for read compound") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
fbed0adfe5
commit
4a67467f11
@@ -6314,7 +6314,7 @@ int smb2_read(struct ksmbd_work *work)
|
||||
aux_payload_buf,
|
||||
nbytes);
|
||||
kvfree(aux_payload_buf);
|
||||
|
||||
aux_payload_buf = NULL;
|
||||
nbytes = 0;
|
||||
if (remain_bytes < 0) {
|
||||
err = (int)remain_bytes;
|
||||
|
||||
Reference in New Issue
Block a user