Skip to content

Commit 6fced05

Browse files
ZhangGuoDongsmfrench
authored andcommitted
smb/server: fix possible memory leak in smb2_read()
Memory leak occurs when ksmbd_vfs_read() fails. Fix this by adding the missing kvfree(). Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 39dec6c commit 6fced05

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6824,6 +6824,7 @@ int smb2_read(struct ksmbd_work *work)
68246824

68256825
nbytes = ksmbd_vfs_read(work, fp, length, &offset, aux_payload_buf);
68266826
if (nbytes < 0) {
6827+
kvfree(aux_payload_buf);
68276828
err = nbytes;
68286829
goto out;
68296830
}

0 commit comments

Comments
 (0)