cifs: Fix lost destroy smbd connection when MR allocate failed
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Fri, 18 Nov 2022 08:42:07 +0000 (16:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:25 +0000 (09:33 +0100)
commitc51ae01104b318bf15f3c5097faba5c72addba7a
tree873de5bb2deed46c8911a19ab5a4be67fa7d2a99
parent349eb7df66079bb70d3d89e3c5974f5202bff202
cifs: Fix lost destroy smbd connection when MR allocate failed

[ Upstream commit e9d3401d95d62a9531082cd2453ed42f2740e3fd ]

If the MR allocate failed, the smb direct connection info is NULL,
then smbd_destroy() will directly return, then the connection info
will be leaked.

Let's set the smb direct connection info to the server before call
smbd_destroy().

Fixes: c7398583340a ("CIFS: SMBD: Implement RDMA memory registration")
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Acked-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Tom Talpey <tom@talpey.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/smbdirect.c