Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 324c0c34 authored by Zhang Xiaoxu's avatar Zhang Xiaoxu Committed by Greg Kroah-Hartman
Browse files

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: c7398583 ("CIFS: SMBD: Implement RDMA memory registration")
Signed-off-by: default avatarZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Acked-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
Reviewed-by: default avatarTom Talpey <tom@talpey.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent a22f1eca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1784,6 +1784,7 @@ static struct smbd_connection *_smbd_get_connection(

allocate_mr_failed:
	/* At this point, need to a full transport shutdown */
	server->smbd_conn = info;
	smbd_destroy(server);
	return NULL;