summaryrefslogtreecommitdiff
path: root/net/bridge/br_if.c
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@o2.pl>2007-02-13 23:35:26 +0300
committerDavid S. Miller <davem@davemloft.net>2007-02-13 23:35:26 +0300
commita10d567c89dfba90dde2e0515e25760fd74cde06 (patch)
tree86fec06aa1dfe1976d489d3d35c9930405d2caa0 /net/bridge/br_if.c
parentbbf4a6bc8c4d59a0a9033fc2cb96ec03430c96e4 (diff)
downloadlinux-a10d567c89dfba90dde2e0515e25760fd74cde06.tar.xz
[BRIDGE] br_if: Fix oops in port_carrier_check
Signed-off-by: Jarek Poplawski <jarkao2@o2.pl> Acked-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_if.c')
-rw-r--r--net/bridge/br_if.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index f35c1a378d0f..aff6a779c9c8 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -108,6 +108,7 @@ static void port_carrier_check(struct work_struct *work)
spin_unlock_bh(&br->lock);
}
done:
+ dev_put(dev);
rtnl_unlock();
}
@@ -161,7 +162,8 @@ static void del_nbp(struct net_bridge_port *p)
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);
br_stp_disable_port(p);
@@ -444,7 +446,9 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
spin_lock_bh(&br->lock);
br_stp_recalculate_bridge_id(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);
dev_set_mtu(br->dev, br_min_mtu(br));