Skip to content

Commit 5c2600a

Browse files
committed
bnx2x: fix page fault following EEH recovery
jira LE-1907 Rebuild_History Non-Buildable kernel-4.18.0-553.8.1.el8_10 commit-author David Christensen <[email protected]> commit 7ebe4ed In the last step of the EEH recovery process, the EEH driver calls into bnx2x_io_resume() to re-initialize the NIC hardware via the function bnx2x_nic_load(). If an error occurs during bnx2x_nic_load(), OS and hardware resources are released and an error code is returned to the caller. When called from bnx2x_io_resume(), the return code is ignored and the network interface is brought up unconditionally. Later attempts to send a packet via this interface result in a page fault due to a null pointer reference. This patch checks the return code of bnx2x_nic_load(), prints an error message if necessary, and does not enable the interface. Signed-off-by: David Christensen <[email protected]> Reviewed-by: Sridhar Samudrala <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit 7ebe4ed) Signed-off-by: Jonathan Maple <[email protected]>
1 parent b442509 commit 5c2600a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14320,11 +14320,16 @@ static void bnx2x_io_resume(struct pci_dev *pdev)
1432014320
bp->fw_seq = SHMEM_RD(bp, func_mb[BP_FW_MB_IDX(bp)].drv_mb_header) &
1432114321
DRV_MSG_SEQ_NUMBER_MASK;
1432214322

14323-
if (netif_running(dev))
14324-
bnx2x_nic_load(bp, LOAD_NORMAL);
14323+
if (netif_running(dev)) {
14324+
if (bnx2x_nic_load(bp, LOAD_NORMAL)) {
14325+
netdev_err(bp->dev, "Error during driver initialization, try unloading/reloading the driver\n");
14326+
goto done;
14327+
}
14328+
}
1432514329

1432614330
netif_device_attach(dev);
1432714331

14332+
done:
1432814333
rtnl_unlock();
1432914334
}
1433014335

0 commit comments

Comments
 (0)