Skip to contentSkip to conversation

bridge deadlock on device removal

PATCH In review Stephen Hemminger 2 participants 2 messages Sep 6, 2004 – Sep 7, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bridge deadlock on device removal

Fixes: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=131569
Dead lock in bridge when removing device interface module. br_del_if assumes br->lock not held.

This fixes case of:
brctl addbr b0
brctl addif b0 eth0
rmmod eth0

net/bridge/br_notify.c +3 -1
diff -Nru a/net/bridge/br_notify.c b/net/bridge/br_notify.c
@@ -76,10 +76,12 @@
 		break;
 
 	case NETDEV_UNREGISTER:
+		spin_unlock_bh(&br->lock);
 		br_del_if(br, dev);
-		break;
+		goto done;
 	} 
 	spin_unlock_bh(&br->lock);
 
+ done:
 	return NOTIFY_DONE;
 }