cifs: fix potential memory leaks in session setup
authorPaulo Alcantara <pc@cjr.nz>
Tue, 10 Jan 2023 23:35:46 +0000 (20:35 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Feb 2023 07:34:32 +0000 (08:34 +0100)
commit893d45394dbe4b5cbf3723c19e2ccc8b93a6ac9b
tree49de36c3d060b616ef185a62c02636d62aede7fb
parentca6263dc22acafc04c0d164900e5662a0e920a8a
cifs: fix potential memory leaks in session setup

[ Upstream commit 2fe58d977ee05da5bb89ef5dc4f5bf2dc15db46f ]

Make sure to free cifs_ses::auth_key.response before allocating it as
we might end up leaking memory in reconnect or mounting.

Signed-off-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/cifsencrypt.c
fs/cifs/sess.c
fs/cifs/smb2pdu.c