Skip to content

Commit 9959fda

Browse files
Vasundhara Volamgregkh
authored andcommitted
bnxt_en: Fix regression in workqueue cleanup logic in bnxt_remove_one().
[ Upstream commit 21d6a11 ] A recent patch has moved the workqueue cleanup logic before calling unregister_netdev() in bnxt_remove_one(). This caused a regression because the workqueue can be restarted if the device is still open. Workqueue cleanup must be done after unregister_netdev(). The workqueue will not restart itself after the device is closed. Call bnxt_cancel_sp_work() after unregister_netdev() and call bnxt_dl_fw_reporters_destroy() after that. This fixes the regession and the original NULL ptr dereference issue. Fixes: b16939b ("bnxt_en: Fix NULL ptr dereference crash in bnxt_fw_reset_task()") Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 524dfe6 commit 9959fda

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • drivers/net/ethernet/broadcom/bnxt

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11790,15 +11790,16 @@ static void bnxt_remove_one(struct pci_dev *pdev)
1179011790
if (BNXT_PF(bp))
1179111791
bnxt_sriov_disable(bp);
1179211792

11793+
if (BNXT_PF(bp))
11794+
devlink_port_type_clear(&bp->dl_port);
11795+
pci_disable_pcie_error_reporting(pdev);
11796+
unregister_netdev(dev);
1179311797
clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state);
11798+
/* Flush any pending tasks */
1179411799
bnxt_cancel_sp_work(bp);
1179511800
bp->sp_event = 0;
1179611801

1179711802
bnxt_dl_fw_reporters_destroy(bp, true);
11798-
if (BNXT_PF(bp))
11799-
devlink_port_type_clear(&bp->dl_port);
11800-
pci_disable_pcie_error_reporting(pdev);
11801-
unregister_netdev(dev);
1180211803
bnxt_dl_unregister(bp);
1180311804
bnxt_shutdown_tc(bp);
1180411805

0 commit comments

Comments
 (0)