From 7ad9cf1c3ef14cd0cf165dcf76d52d25855ea15b Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 6 Sep 2004 23:49:43 -0700 Subject: [PATCH] [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 Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- net/bridge/br_notify.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c index d0702fbcb21de..f8fb49e34764e 100644 --- a/net/bridge/br_notify.c +++ b/net/bridge/br_notify.c @@ -76,10 +76,12 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v 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; } -- 2.53.0