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)
committerSteve French <stfrench@microsoft.com>
Thu, 1 Jun 2023 04:02:32 +0000 (23:02 -0500)
commitc2717c0cf20c0e5a20bfcf636f51b92a9a53d04c
tree9c994dd2ba594a0ab88329d84899270075d81c90
parente218a6060cfe287756795f95935943539c25d0ce
cifs: Fix lost destroy smbd connection when MR allocate failed

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>
fs/cifs/smbdirect.c