Message ID | 20210529082058.3012233-1-yangyingliang@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [-next,1/3] cifsd: fix memleak in ksmbd_vfs_stream_write() | expand |
> Before assigning wbuf to stream_buf, memory allocate in > ksmbd_vfs_getcasexattr() need be freed. > > Fixes: f44158485826 ("cifsd: add file operations") > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> I will apply, Thanks for your patch!
diff --git a/fs/cifsd/vfs.c b/fs/cifsd/vfs.c index 291953eff5fa..9057b30278b9 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); + kfree(stream_buf); stream_buf = wbuf; }
Before assigning wbuf to stream_buf, memory allocate in ksmbd_vfs_getcasexattr() need be freed. Fixes: f44158485826 ("cifsd: add file operations") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- fs/cifsd/vfs.c | 1 + 1 file changed, 1 insertion(+)