Patchwork bnx2x: Prevent eeprom set when driver is down

login
register
mail settings
Submitter Eilon Greenstein
Date Jan. 8, 2009, 3:40 p.m.
Message ID <1231429212.11301.13.camel@lb-tlvb-eliezer>
Download mbox | patch
Permalink /patch/17377/
State Accepted
Delegated to: David Miller
Headers show

Comments

Eilon Greenstein - Jan. 8, 2009, 3:40 p.m.
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/bnx2x_main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
David Miller - Jan. 8, 2009, 7:21 p.m.
From: "Eilon Greenstein" <eilong@broadcom.com>
Date: Thu, 08 Jan 2009 17:40:12 +0200

> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied, thank you.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 600210d..425cbae 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -8246,6 +8246,9 @@  static int bnx2x_set_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,