Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa40cf19 authored by Ding Hui's avatar Ding Hui Committed by Greg Kroah-Hartman
Browse files

cifs: fix wrong release in sess_alloc_buffer() failed path



[ Upstream commit d72c74197b70bc3c95152f351a568007bffa3e11 ]

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: default avatarDing Hui <dinghui@sangfor.com.cn>
Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 39111cbb
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -610,7 +610,7 @@ sess_alloc_buffer(struct sess_data *sess_data, int wct)
	return 0;
	return 0;


out_free_smb_buf:
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_base = NULL;
	sess_data->iov[0].iov_len = 0;
	sess_data->iov[0].iov_len = 0;
	sess_data->buf0_type = CIFS_NO_BUFFER;
	sess_data->buf0_type = CIFS_NO_BUFFER;