提交 a10d567c 编写于 作者: J Jarek Poplawski 提交者: David S. Miller

[BRIDGE] br_if: Fix oops in port_carrier_check

Signed-off-by: NJarek Poplawski <jarkao2@o2.pl>
Acked-by: NStephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 bbf4a6bc
...@@ -108,6 +108,7 @@ static void port_carrier_check(struct work_struct *work) ...@@ -108,6 +108,7 @@ static void port_carrier_check(struct work_struct *work)
spin_unlock_bh(&br->lock); spin_unlock_bh(&br->lock);
} }
done: done:
dev_put(dev);
rtnl_unlock(); rtnl_unlock();
} }
...@@ -161,7 +162,8 @@ static void del_nbp(struct net_bridge_port *p) ...@@ -161,7 +162,8 @@ static void del_nbp(struct net_bridge_port *p)
dev_set_promiscuity(dev, -1); dev_set_promiscuity(dev, -1);
cancel_delayed_work(&p->carrier_check); if (cancel_delayed_work(&p->carrier_check))
dev_put(dev);
spin_lock_bh(&br->lock); spin_lock_bh(&br->lock);
br_stp_disable_port(p); br_stp_disable_port(p);
...@@ -444,7 +446,9 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) ...@@ -444,7 +446,9 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
spin_lock_bh(&br->lock); spin_lock_bh(&br->lock);
br_stp_recalculate_bridge_id(br); br_stp_recalculate_bridge_id(br);
br_features_recompute(br); br_features_recompute(br);
schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE); if (schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE))
dev_hold(dev);
spin_unlock_bh(&br->lock); spin_unlock_bh(&br->lock);
dev_set_mtu(br->dev, br_min_mtu(br)); dev_set_mtu(br->dev, br_min_mtu(br));
......
...@@ -56,7 +56,9 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v ...@@ -56,7 +56,9 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
case NETDEV_CHANGE: case NETDEV_CHANGE:
if (br->dev->flags & IFF_UP) if (br->dev->flags & IFF_UP)
schedule_delayed_work(&p->carrier_check, BR_PORT_DEBOUNCE); if (schedule_delayed_work(&p->carrier_check,
BR_PORT_DEBOUNCE))
dev_hold(dev);
break; break;
case NETDEV_FEAT_CHANGE: case NETDEV_FEAT_CHANGE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册