mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-16 10:17:32 +00:00
bnx2x: Block nvram access when the device is inactive
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>
This commit is contained in:
parent
5a40e08e66
commit
2add3acb11
@ -8107,6 +8107,9 @@ static int bnx2x_get_eeprom(struct net_device *dev,
|
|||||||
struct bnx2x *bp = netdev_priv(dev);
|
struct bnx2x *bp = netdev_priv(dev);
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
if (!netif_running(dev))
|
||||||
|
return -EAGAIN;
|
||||||
|
|
||||||
DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n"
|
DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n"
|
||||||
DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n",
|
DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n",
|
||||||
eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset,
|
eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user