[openib-general] [PATCH] ib_sa: Fix kernel Oops caused by ib_sa unload

Yosef Etigin yosefe at voltaire.com
Mon Dec 18 08:21:21 PST 2006


This is a fix to Sean's multicast patches for ofed 1.2.

The issuse is described in: 
http://www.mail-archive.com/openib-general@openib.org/msg27097.html

The Oops happened because the multicast work handler was called
after the multicast device structure was released. It happened because
the multicast cleanup function 'mcast_remove_one' didn't wait for
work queue completion on all ports before releasing the device, but 
only N-1 ports.

The patch applies after Sean's multicast patch series.

---
 multicast.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/drivers/infiniband/core/multicast.c
b/drivers/infiniband/core/multicast.c
index a8ff6fa..4e15fd3 100644
--- a/drivers/infiniband/core/multicast.c
+++ b/drivers/infiniband/core/multicast.c
@@ -822,7 +822,7 @@ static void mcast_remove_one(struct ib_d
 	ib_unregister_event_handler(&event_handler);
 	flush_workqueue(mcast_wq);
 
-	for (i = 0; i < dev->end_port - dev->start_port; i++) {
+	for (i = 0; i <= dev->end_port - dev->start_port; i++) {
 		port = &dev->port[i];
 		deref_port(port);
 		wait_for_completion(&port->comp);
--

Yosef Etigin
yosefe at voltaire.com






More information about the general mailing list