mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
smb/server: fix possible memory leak in smb2_read()
[ Upstream commit 6fced056d2 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d75079bbab
commit
bfda5422a1
@@ -6826,6 +6826,7 @@ int smb2_read(struct ksmbd_work *work)
|
|||||||
|
|
||||||
nbytes = ksmbd_vfs_read(work, fp, length, &offset, aux_payload_buf);
|
nbytes = ksmbd_vfs_read(work, fp, length, &offset, aux_payload_buf);
|
||||||
if (nbytes < 0) {
|
if (nbytes < 0) {
|
||||||
|
kvfree(aux_payload_buf);
|
||||||
err = nbytes;
|
err = nbytes;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user