]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitde94360e9717946b6f3949d212f2a078b63cc3e6
tree873de5bb2deed46c8911a19ab5a4be67fa7d2a99
parent4fefe6fe3fe37d85f06d32cc0d1f3860d3058944
cifs: Fix lost destroy smbd connection when MR allocate failed

[ Upstream commit 4ad25b31a3408547e44363eca61d6727ed4c8fc7 ]

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: 7b3a72c2f9ee ("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