Commit 32003a7d authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Hideaki Yoshifuji

[BRIDGE]: Possible race with timer on shutdown.

parent d5e0fad5
...@@ -105,12 +105,7 @@ static void br_dev_set_multicast_list(struct net_device *dev) ...@@ -105,12 +105,7 @@ static void br_dev_set_multicast_list(struct net_device *dev)
static int br_dev_stop(struct net_device *dev) static int br_dev_stop(struct net_device *dev)
{ {
struct net_bridge *br; br_stp_disable_bridge(dev->priv);
br = dev->priv;
write_lock(&br->lock);
br_stp_disable_bridge(br);
write_unlock(&br->lock);
netif_stop_queue(dev); netif_stop_queue(dev);
......
...@@ -64,11 +64,12 @@ void br_stp_enable_bridge(struct net_bridge *br) ...@@ -64,11 +64,12 @@ void br_stp_enable_bridge(struct net_bridge *br)
br_timer_set(&br->gc_timer, jiffies); br_timer_set(&br->gc_timer, jiffies);
} }
/* called under bridge lock */ /* NO locks held */
void br_stp_disable_bridge(struct net_bridge *br) void br_stp_disable_bridge(struct net_bridge *br)
{ {
struct net_bridge_port *p; struct net_bridge_port *p;
write_lock(&br->lock);
br->topology_change = 0; br->topology_change = 0;
br->topology_change_detected = 0; br->topology_change_detected = 0;
br_timer_clear(&br->hello_timer); br_timer_clear(&br->hello_timer);
...@@ -84,6 +85,7 @@ void br_stp_disable_bridge(struct net_bridge *br) ...@@ -84,6 +85,7 @@ void br_stp_disable_bridge(struct net_bridge *br)
p = p->next; p = p->next;
} }
write_unlock(&br->lock);
del_timer_sync(&br->tick); del_timer_sync(&br->tick);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment