Subject: [PATCH 22/66] net/smc: cancel event worker during device removal

From: Karsten Graul <[email-masked]>
Date: Tue, 10 Mar 2020 09:33:30 +0100

[ Upstream commit ece0d7bd74615773268475b6b64d6f1ebbd4b4c6 ]

During IB device removal, cancel the event worker before the device
structure is freed.

Fixes: a4cf0443c414 ("smc: introduce SMC as an IB-client")
Reported-by: [email-masked]
Signed-off-by: Karsten Graul <[email-masked]>
Reviewed-by: Ursula Braun <[email-masked]>
Reviewed-by: Leon Romanovsky <[email-masked]>
Signed-off-by: David S. Miller <[email-masked]>
---
 net/smc/smc_ib.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c
index 548632621f4b..32fee2ca7c4c 100644
--- a/net/smc/smc_ib.c
+++ b/net/smc/smc_ib.c
@@ -580,6 +580,7 @@ static void smc_ib_remove_dev(struct ib_device *ibdev, void *client_data)
 	smc_smcr_terminate_all(smcibdev);
 	smc_ib_cleanup_per_ibdev(smcibdev);
 	ib_unregister_event_handler(&smcibdev->event_handler);
+	cancel_work_sync(&smcibdev->port_event_work);
 	kfree(smcibdev);
 }
 
-- 
2.20.1