summaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorDing Hui <dinghui@sangfor.com.cn>2021-08-17 17:55:10 +0300
committerSteve French <stfrench@microsoft.com>2021-08-25 23:42:18 +0300
commitd72c74197b70bc3c95152f351a568007bffa3e11 (patch)
treebbf41fc84cefc3adeadcf0ad38d0693c78675209 /fs/cifs
parentf980d055a0f858d73d9467bb0b570721bbfcdfb8 (diff)
downloadlinux-d72c74197b70bc3c95152f351a568007bffa3e11.tar.xz
cifs: fix wrong release in sess_alloc_buffer() failed path
smb_buf is allocated by small_smb_init_no_tc(), and buf type is CIFS_SMALL_BUFFER, so we should use cifs_small_buf_release() to release it in failed path. Signed-off-by: Ding Hui <dinghui@sangfor.com.cn> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/sess.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index c5785fd3f52e..606fd7d6cb71 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -877,7 +877,7 @@ sess_alloc_buffer(struct sess_data *sess_data, int wct)
return 0;
out_free_smb_buf:
- kfree(smb_buf);
+ cifs_small_buf_release(smb_buf);
sess_data->iov[0].iov_base = NULL;
sess_data->iov[0].iov_len = 0;
sess_data->buf0_type = CIFS_NO_BUFFER;