]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.27.14/bnx2x-block-nvram-access-when-the-device-is-inactive.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 2.6.27.14 / bnx2x-block-nvram-access-when-the-device-is-inactive.patch
CommitLineData
5861a31d
GKH
1From 2add3acb11a26cc14b54669433ae6ace6406cbf2 Mon Sep 17 00:00:00 2001
2From: Eilon Greenstein <eilong@broadcom.com>
3Date: Wed, 14 Jan 2009 06:44:07 +0000
4Subject: bnx2x: Block nvram access when the device is inactive
5
6From: Eilon Greenstein <eilong@broadcom.com>
7
8commit 2add3acb11a26cc14b54669433ae6ace6406cbf2 upstream.
9
10Don't dump eeprom when bnx2x adapter is down. Running ethtool -e causes an eeh
11without it when the device is down
12
13Signed-off-by: Paul Larson <pl@linux.vnet.ibm.com>
14Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
15Signed-off-by: David S. Miller <davem@davemloft.net>
16Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17
18---
19 drivers/net/bnx2x_main.c | 3 +++
20 1 file changed, 3 insertions(+)
21
22--- a/drivers/net/bnx2x_main.c
23+++ b/drivers/net/bnx2x_main.c
24@@ -8078,6 +8078,9 @@ static int bnx2x_get_eeprom(struct net_d
25 struct bnx2x *bp = netdev_priv(dev);
26 int rc;
27
28+ if (!netif_running(dev))
29+ return -EAGAIN;
30+
31 DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n"
32 DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n",
33 eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset,