diff options
| author | ZhangGuoDong <zhangguodong@kylinos.cn> | 2025-10-12 00:47:59 +0800 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2025-10-15 06:03:09 -0500 |
| commit | 6fced056d2cc8d01b326e6fcfabaacb9850b71a4 (patch) | |
| tree | c491924ae24dceb359981a5252601a8cbc158a20 | |
| parent | 39dec6cd888bde4171bd4b8fcf45f73ab684404d (diff) | |
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>
| -rw-r--r-- | fs/smb/server/smb2pdu.c | 1 |
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; } |
