Skip to content

Commit 55c79f4

Browse files
namjaejeonroxanan1996
authored andcommitted
ksmbd: fix passing freed memory 'aux_payload_buf'
BugLink: https://bugs.launchpad.net/bugs/2052406 [ Upstream commit 59d8d24 ] The patch e2b76ab: "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: e2b76ab ("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> Signed-off-by: Portia Stephens <portia.stephens@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
1 parent 51c925d commit 55c79f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ksmbd/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6314,7 +6314,7 @@ int smb2_read(struct ksmbd_work *work)
63146314
aux_payload_buf,
63156315
nbytes);
63166316
kvfree(aux_payload_buf);
6317-
6317+
aux_payload_buf = NULL;
63186318
nbytes = 0;
63196319
if (remain_bytes < 0) {
63206320
err = (int)remain_bytes;

0 commit comments

Comments
 (0)