diff mbox series

[RFC,03/13] cifs: Fix oops due to uncleared server->smbd_conn in reconnect

Message ID 20230125214543.2337639-4-dhowells@redhat.com (mailing list archive)
State New, archived
Headers show
Series smb3: Use iov_iters down to the network transport and fix DIO page pinning | expand

Commit Message

David Howells Jan. 25, 2023, 9:45 p.m. UTC
In smbd_destroy(), clear the server->smbd_conn pointer after freeing the
smbd_connection struct that it points to so that reconnection doesn't get
confused.

Fixes: 8ef130f9ec27 ("CIFS: SMBD: Implement function to destroy a SMB Direct connection")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Long Li <longli@microsoft.com>
cc: Steve French <smfrench@gmail.com>
cc: Pavel Shilovsky <pshilov@microsoft.com>
cc: Ronnie Sahlberg <lsahlber@redhat.com>
cc: linux-cifs@vger.kernel.org
---
 fs/cifs/smbdirect.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
index 90789aaa6567..8c816b25ce7c 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/smbdirect.c
@@ -1405,6 +1405,7 @@  void smbd_destroy(struct TCP_Server_Info *server)
 	destroy_workqueue(info->workqueue);
 	log_rdma_event(INFO,  "rdma session destroyed\n");
 	kfree(info);
+	server->smbd_conn = NULL;
 }
 
 /*