Skip to content

Commit 59d8d24

Browse files
namjaejeonSteve French
authored andcommitted
ksmbd: fix passing freed memory 'aux_payload_buf'
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>
1 parent e4e1409 commit 59d8d24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/server/smb2pdu.c

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

0 commit comments

Comments
 (0)