Skip to content

Commit

Permalink
cifsd: fix memleak in ksmbd_vfs_stream_write()
Browse files Browse the repository at this point in the history
Before assigning wbuf to stream_buf, memory allocate in
ksmbd_vfs_getcasexattr() need be freed.

Signed-off-by: Yang Yingliang <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
Signed-off-by: Steve French <[email protected]>
  • Loading branch information
Yang Yingliang authored and namjaejeon committed May 31, 2021
1 parent d7e5852 commit 113ef68
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/cifsd/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 113ef68

Please sign in to comment.