[TG3]: Add some missing netif_running() checks
authorMichael Chan <mchan@broadcom.com>
Tue, 21 Mar 2006 05:33:26 +0000 (21:33 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Mar 2006 05:33:26 +0000 (21:33 -0800)
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>
drivers/net/tg3.c

index 994658d26b8e83d87ecf6584ab131a2a105ca6bf..f7da3bf2fa0988d57071dca6cb882996123a9021 100644 (file)
@@ -5537,6 +5537,9 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p)
 
        memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
 
+       if (!netif_running(dev))
+               return 0;
+
        spin_lock_bh(&tp->lock);
        __tg3_set_mac_addr(tp);
        spin_unlock_bh(&tp->lock);
@@ -7192,6 +7195,9 @@ static void tg3_set_rx_mode(struct net_device *dev)
 {
        struct tg3 *tp = netdev_priv(dev);
 
+       if (!netif_running(dev))
+               return;
+
        tg3_full_lock(tp, 0);
        __tg3_set_rx_mode(dev);
        tg3_full_unlock(tp);