Commit 59d8d24f authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French

ksmbd: fix passing freed memory 'aux_payload_buf'

The patch e2b76ab8: "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: e2b76ab8 ("ksmbd: add support for read compound")
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent e4e14095
...@@ -6312,7 +6312,7 @@ int smb2_read(struct ksmbd_work *work) ...@@ -6312,7 +6312,7 @@ int smb2_read(struct ksmbd_work *work)
aux_payload_buf, aux_payload_buf,
nbytes); nbytes);
kvfree(aux_payload_buf); kvfree(aux_payload_buf);
aux_payload_buf = NULL;
nbytes = 0; nbytes = 0;
if (remain_bytes < 0) { if (remain_bytes < 0) {
err = (int)remain_bytes; err = (int)remain_bytes;
......
Markdown is supported
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