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>

authored by Sarveshwar Bandi and committed by David S. Miller d9efd2af dba4490d

+6
+6
drivers/net/benet/be_main.c
··· 2458 2458 int status, i = 0, num_imgs = 0; 2459 2459 const u8 *p; 2460 2460 2461 + if (!netif_running(adapter->netdev)) { 2462 + dev_err(&adapter->pdev->dev, 2463 + "Firmware load not allowed (interface is down)\n"); 2464 + return -EPERM; 2465 + } 2466 + 2461 2467 strcpy(fw_file, func); 2462 2468 2463 2469 status = request_firmware(&fw, fw_file, &adapter->pdev->dev);