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
[ Upstream commit e9d3401 ]

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 <[email protected]>
Acked-by: Paulo Alcantara (SUSE) <[email protected]>
Reviewed-by: David Howells <[email protected]>
Reviewed-by: Tom Talpey <[email protected]>
Signed-off-by: Steve French <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
z00467499 authored and gregkh committed Mar 10, 2023
1 parent c1dcc9f commit 04b7e13
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 04b7e13

Please sign in to comment.