aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorZhangGuoDong <zhangguodong@kylinos.cn>2025-10-12 00:47:59 +0800
committerSteve French <stfrench@microsoft.com>2025-10-15 06:03:09 -0500
commit6fced056d2cc8d01b326e6fcfabaacb9850b71a4 (patch)
treec491924ae24dceb359981a5252601a8cbc158a20 /fs
parentsmb: server: Use common error handling code in smb_direct_rdma_xmit() (diff)
downloadlinux-6fced056d2cc8d01b326e6fcfabaacb9850b71a4.tar.gz
linux-6fced056d2cc8d01b326e6fcfabaacb9850b71a4.zip
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/smb/server/smb2pdu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index ab1d45fcebde..e81e615f322a 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -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;
}