mirror of https://github.com/torvalds/linux.git
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>
This commit is contained in:
parent
39dec6cd88
commit
6fced056d2
|
|
@ -6824,6 +6824,7 @@ int smb2_read(struct ksmbd_work *work)
|
|||
|
||||
nbytes = ksmbd_vfs_read(work, fp, length, &offset, aux_payload_buf);
|
||||
if (nbytes < 0) {
|
||||
kvfree(aux_payload_buf);
|
||||
err = nbytes;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue