cifs: fix small mempool leak in SMB2_negotiate()
authorEnzo Matsumiya <ematsumiya@suse.de>
Tue, 30 Aug 2022 22:51:51 +0000 (19:51 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Sep 2022 10:28:04 +0000 (12:28 +0200)
commit9e3c9efa7caf16e5acc05eab5e4d0a714e1610b0
treec214ad5f4d19a352213b45c879417e4c15c0109d
parent81203ab7a6ef843a2b904a0a494f28c457d44d27
cifs: fix small mempool leak in SMB2_negotiate()

commit 27893dfc1285f80f80f46b3b8c95f5d15d2e66d0 upstream.

In some cases of failure (dialect mismatches) in SMB2_negotiate(), after
the request is sent, the checks would return -EIO when they should be
rather setting rc = -EIO and jumping to neg_exit to free the response
buffer from mempool.

Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Cc: stable@vger.kernel.org
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2pdu.c