[openib-general] [PATCH] fix crash on hotplug

Michael S. Tsirkin mst at mellanox.co.il
Mon Jan 16 07:42:33 PST 2006


The following fixes a crash on module unload that we saw in testing.

SA even handler does schedule_work so we must flush_scheduled_work
after deregistering event handler.

---

Flush work scheduled by sa event handler.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: openib/drivers/infiniband/core/sa_query.c
===================================================================
--- openib/drivers/infiniband/core/sa_query.c	(revision 4985)
+++ openib/drivers/infiniband/core/sa_query.c	(working copy)
@@ -955,6 +955,8 @@ static void ib_sa_remove_one(struct ib_d
 
 	ib_unregister_event_handler(&sa_dev->event_handler);
 
+	flush_scheduled_work();
+
 	for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) {
 		ib_unregister_mad_agent(sa_dev->port[i].agent);
 		kref_put(&sa_dev->port[i].sm_ah->ref, free_sm_ah);

-- 
MST



More information about the general mailing list