From: Yang Yingliang Date: Sat, 29 May 2021 08:20:56 +0000 (+0800) Subject: cifsd: fix memleak in ksmbd_vfs_stream_write() X-Git-Tag: accepted/tizen/unified/20230118.172025~6553^2~16^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=113ef68d47f5d36611c16a6ef4bd2a837aa344ab;p=platform%2Fkernel%2Flinux-rpi.git cifsd: fix memleak in ksmbd_vfs_stream_write() Before assigning wbuf to stream_buf, memory allocate in ksmbd_vfs_getcasexattr() need be freed. Signed-off-by: Yang Yingliang Signed-off-by: Namjae Jeon Signed-off-by: Steve French --- diff --git a/fs/cifsd/vfs.c b/fs/cifsd/vfs.c index cd03759..e70b67e 100644 --- a/fs/cifsd/vfs.c +++ b/fs/cifsd/vfs.c @@ -429,6 +429,7 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos, if (v_len > 0) memcpy(wbuf, stream_buf, v_len); + kvfree(stream_buf); stream_buf = wbuf; }