提交 d9efd2af 编写于 作者: S Sarveshwar Bandi 提交者: David S. Miller

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: NSarveshwar Bandi <Sarveshwar.Bandi@emulex.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 dba4490d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册