summaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorSarveshwar Bandi <Sarveshwar.Bandi@emulex.com>2010-11-18 23:44:45 +0000
committerDavid S. Miller <davem@davemloft.net>2010-11-19 08:57:19 -0800
commitd9efd2af461abb7b54c49c1b7e654d496dd1d379 (patch)
treebd5adfe7c959ea1bca55f0f7dcd7e2c23701a304 /drivers/net/benet
parentdba4490d22a496f9b7c21919cf3effbed5851213 (diff)
downloadlinux-d9efd2af461abb7b54c49c1b7e654d496dd1d379.tar.bz2
be2net: Fix to avoid firmware update when interface is not open.
Since interrupts are enabled only when open is called on the interface, Attempting a firmware update operation when interface is down could lead to partial success or failure of operation. This fix fails the request if netif_running is false. Signed-off-by: Sarveshwar Bandi <Sarveshwar.Bandi@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index c36cd2ffbadc..93354eee2cfd 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -2458,6 +2458,12 @@ int be_load_fw(struct be_adapter *adapter, u8 *func)
int status, i = 0, num_imgs = 0;
const u8 *p;
+ if (!netif_running(adapter->netdev)) {
+ dev_err(&adapter->pdev->dev,
+ "Firmware load not allowed (interface is down)\n");
+ return -EPERM;
+ }
+
strcpy(fw_file, func);
status = request_firmware(&fw, fw_file, &adapter->pdev->dev);