Skip to contentSkip to conversation

be2net: Fix to avoid firmware update when interface is not open.

PATCH Applied Sarveshwar Bandi 2 participants 2 messages Nov 19, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/benet/be_main.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/net/benet/be_main.c +6 -0
index c36cd2f..93354ee 100644
@@ -2458,6 +2458,12 @@ int be_load_fw(struct be_adapter *adapte
 	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);
Signature · 1 line
1.4.0
maintainer Applied
#1 lore raw

From: Sarveshwar Bandi <[email protected]>
Date: Fri, 19 Nov 2010 15:14:45 +0530

Quoted 6 lines

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.

Applied, thank you.