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 <[EMAIL PROTECTED]>


diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index f147d73..d399613 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -5520,6 +5520,9 @@ static int tg3_set_mac_addr(struct net_d
 
        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);
@@ -7175,6 +7178,9 @@ static void tg3_set_rx_mode(struct net_d
 {
        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);


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to