diff options
author | Ding Hui <dinghui@sangfor.com.cn> | 2021-08-17 22:55:10 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-22 11:45:31 +0200 |
commit | ab8177e6d340f43ba442cfad8e777cae1748a7b6 (patch) | |
tree | 6b2fa1132f7f5834947d6e769beb48f71ed9354c /fs/cifs | |
parent | c21916ffd0dbdda3cd12609bf823f0f3113e5b61 (diff) | |
download | linux-rt-ab8177e6d340f43ba442cfad8e777cae1748a7b6.tar.gz |
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: Ding Hui <dinghui@sangfor.com.cn>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/sess.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index aa23c00367ec..0113dba28eb0 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -602,7 +602,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; |