Skip to content

Commit

Permalink
cifs: Fix lost destroy smbd connection when MR allocate failed
Browse files Browse the repository at this point in the history
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: c739858 ("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>
  • Loading branch information
z00467499 authored and Steve French committed Feb 20, 2023
1 parent 8e843bf commit e9d3401
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/cifs/smbdirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,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;

Expand Down

0 comments on commit e9d3401

Please sign in to comment.