Skip to content

Commit

Permalink
[TG3]: Add some missing netif_running() checks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Chan authored and David S. Miller committed Mar 21, 2006
1 parent 0e7b136 commit e75f7c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit e75f7c9

Please sign in to comment.