From: Eilon Greenstein Date: Wed, 14 Jan 2009 06:44:07 +0000 (+0000) Subject: bnx2x: Block nvram access when the device is inactive Patch-mainline: 2.6.29-rc3 Git-commit: 2add3acb11a26cc14b54669433ae6ace6406cbf2 References: bnc#470898 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 Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller Acked-by: Jeff Mahoney --- drivers/net/bnx2x_main.c | 3 +++ 1 file changed, 3 insertions(+) Index: linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c =================================================================== --- linux-2.6.27-bnx2x_2.orig/drivers/net/bnx2x_main.c +++ linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c @@ -8280,6 +8280,9 @@ static int bnx2x_set_eeprom(struct net_d 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,