diff options
author | Michael Chan <mchan@broadcom.com> | 2006-03-21 00:33:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 00:33:26 -0500 |
commit | e75f7c900944aa90831f6d343ca40090a68b56dd (patch) | |
tree | d5192f5c230a2e84a6a0b23eed7e802ebf6ab555 /drivers | |
parent | 0e7b13685f9a06949ea3070c97c0f0085a08cd37 (diff) |
[TG3]: Add some missing netif_running() checks
Add missing netif_running() checks in tg3's dev->set_multicast_list()
and dev->set_mac_address(). If not netif_running(), these 2 calls can
simply return 0 after storing the new settings if required.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/tg3.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 994658d26b8e..f7da3bf2fa09 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -5537,6 +5537,9 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p) | |||
5537 | 5537 | ||
5538 | memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); | 5538 | memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); |
5539 | 5539 | ||
5540 | if (!netif_running(dev)) | ||
5541 | return 0; | ||
5542 | |||
5540 | spin_lock_bh(&tp->lock); | 5543 | spin_lock_bh(&tp->lock); |
5541 | __tg3_set_mac_addr(tp); | 5544 | __tg3_set_mac_addr(tp); |
5542 | spin_unlock_bh(&tp->lock); | 5545 | spin_unlock_bh(&tp->lock); |
@@ -7192,6 +7195,9 @@ static void tg3_set_rx_mode(struct net_device *dev) | |||
7192 | { | 7195 | { |
7193 | struct tg3 *tp = netdev_priv(dev); | 7196 | struct tg3 *tp = netdev_priv(dev); |
7194 | 7197 | ||
7198 | if (!netif_running(dev)) | ||
7199 | return; | ||
7200 | |||
7195 | tg3_full_lock(tp, 0); | 7201 | tg3_full_lock(tp, 0); |
7196 | __tg3_set_rx_mode(dev); | 7202 | __tg3_set_rx_mode(dev); |
7197 | tg3_full_unlock(tp); | 7203 | tg3_full_unlock(tp); |