Commit 7ebe4eda authored by David Christensen's avatar David Christensen Committed by David S. Miller

bnx2x: fix page fault following EEH recovery

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: default avatarDavid Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: default avatarSridhar Samudrala <sridhar.samudrala@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 65d8bd81
...@@ -14294,11 +14294,16 @@ static void bnx2x_io_resume(struct pci_dev *pdev) ...@@ -14294,11 +14294,16 @@ static void bnx2x_io_resume(struct pci_dev *pdev)
bp->fw_seq = SHMEM_RD(bp, func_mb[BP_FW_MB_IDX(bp)].drv_mb_header) & bp->fw_seq = SHMEM_RD(bp, func_mb[BP_FW_MB_IDX(bp)].drv_mb_header) &
DRV_MSG_SEQ_NUMBER_MASK; DRV_MSG_SEQ_NUMBER_MASK;
if (netif_running(dev)) if (netif_running(dev)) {
bnx2x_nic_load(bp, LOAD_NORMAL); if (bnx2x_nic_load(bp, LOAD_NORMAL)) {
netdev_err(bp->dev, "Error during driver initialization, try unloading/reloading the driver\n");
goto done;
}
}
netif_device_attach(dev); netif_device_attach(dev);
done:
rtnl_unlock(); rtnl_unlock();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment