Skip to content

Commit

Permalink
be2net: Fix to avoid firmware update when interface is not open.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sarveshwar Bandi authored and David S. Miller committed Nov 19, 2010
1 parent dba4490 commit d9efd2a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d9efd2a

Please sign in to comment.