cifs: don't leak -ENOMEM in smb2_open_file()
authorPaulo Alcantara <pc@cjr.nz>
Mon, 19 Dec 2022 13:21:50 +0000 (10:21 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:56 +0000 (13:32 +0100)
commitae6fb31c0086dfe468a63c346ff55a86ed9950c7
tree74dd2daa0b4af00fa275301d786f2b6f1d1e0489
parenta37f6d5541b29adab22a7de8e39872b32cdcf914
cifs: don't leak -ENOMEM in smb2_open_file()

[ Upstream commit f60ffa662d1427cfd31fe9d895c3566ac50bfe52 ]

A NULL error response might be a valid case where smb2_reconnect()
failed to reconnect the session and tcon due to a disconnected server
prior to issuing the I/O operation, so don't leak -ENOMEM to userspace
on such occasions.

Fixes: 76894f3e2f71 ("cifs: improve symlink handling for smb2+")
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/smb2file.c