cifs: fix wrong release in sess_alloc_buffer() failed path
authorDing Hui <dinghui@sangfor.com.cn>
Tue, 17 Aug 2021 14:55:10 +0000 (22:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:40:32 +0000 (13:40 +0200)
commitba2faddf1f14c2a7ecb0adecaebcc332c919cf05
tree62698a0f22390026eabc1b28f16071959feebfdb
parent7c7d6c9cd879a4bb19b101735858a175e698219b
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>
fs/cifs/sess.c