diff options
author | Eilon Greenstein <eilong@broadcom.com> | 2009-01-14 06:44:07 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-02-02 08:28:12 -0800 |
commit | e230bf234f40f493a284c4dbcec0b331529b609f (patch) | |
tree | 582759085cde03421641d7e34332b82227735a03 /drivers/net/bnx2x_main.c | |
parent | 2081e491dd998c75a206f8a8a75df586197aace9 (diff) |
bnx2x: Block nvram access when the device is inactive
commit 2add3acb11a26cc14b54669433ae6ace6406cbf2 upstream.
Don't dump eeprom when bnx2x adapter is down. Running ethtool -e causes an eeh
without it when the device is down
Signed-off-by: Paul Larson <pl@linux.vnet.ibm.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r-- | drivers/net/bnx2x_main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 53459db67ba..8d44404ce08 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c @@ -8078,6 +8078,9 @@ static int bnx2x_get_eeprom(struct net_device *dev, struct bnx2x *bp = netdev_priv(dev); int rc; + if (!netif_running(dev)) + return -EAGAIN; + DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n" DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n", eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset, |