diff options
Diffstat (limited to 'drivers/net/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index f98a2205a090..9f0a06722e23 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -5562,6 +5562,9 @@ bnx2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
5562 | case SIOCGMIIREG: { | 5562 | case SIOCGMIIREG: { |
5563 | u32 mii_regval; | 5563 | u32 mii_regval; |
5564 | 5564 | ||
5565 | if (!netif_running(dev)) | ||
5566 | return -EAGAIN; | ||
5567 | |||
5565 | spin_lock_bh(&bp->phy_lock); | 5568 | spin_lock_bh(&bp->phy_lock); |
5566 | err = bnx2_read_phy(bp, data->reg_num & 0x1f, &mii_regval); | 5569 | err = bnx2_read_phy(bp, data->reg_num & 0x1f, &mii_regval); |
5567 | spin_unlock_bh(&bp->phy_lock); | 5570 | spin_unlock_bh(&bp->phy_lock); |
@@ -5575,6 +5578,9 @@ bnx2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
5575 | if (!capable(CAP_NET_ADMIN)) | 5578 | if (!capable(CAP_NET_ADMIN)) |
5576 | return -EPERM; | 5579 | return -EPERM; |
5577 | 5580 | ||
5581 | if (!netif_running(dev)) | ||
5582 | return -EAGAIN; | ||
5583 | |||
5578 | spin_lock_bh(&bp->phy_lock); | 5584 | spin_lock_bh(&bp->phy_lock); |
5579 | err = bnx2_write_phy(bp, data->reg_num & 0x1f, data->val_in); | 5585 | err = bnx2_write_phy(bp, data->reg_num & 0x1f, data->val_in); |
5580 | spin_unlock_bh(&bp->phy_lock); | 5586 | spin_unlock_bh(&bp->phy_lock); |