This is a note to let you know that I've just added the patch titled [PATCH stable 5.8 02/22] bnxt_en: Fix regression in workqueue cleanup logic in bnxt_remove_one(). to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: bnxt_en-fix-regression-in-workqueue-cleanup-logic-in-bnxt_remove_one.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Sat Oct 31 10:12:02 AM CET 2020 From: Vasundhara Volam <vasundhara-v.volam@xxxxxxxxxxxx> Date: Mon, 26 Oct 2020 00:18:17 -0400 Subject: [PATCH stable 5.8 02/22] bnxt_en: Fix regression in workqueue cleanup logic in bnxt_remove_one(). From: Vasundhara Volam <vasundhara-v.volam@xxxxxxxxxxxx> [ Upstream commit 21d6a11e2cadfb8446265a3efff0e2aad206e15e ] 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: b16939b59cc0 ("bnxt_en: Fix NULL ptr dereference crash in bnxt_fw_reset_task()") Signed-off-by: Vasundhara Volam <vasundhara-v.volam@xxxxxxxxxxxx> Signed-off-by: Michael Chan <michael.chan@xxxxxxxxxxxx> Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11396,13 +11396,14 @@ static void bnxt_remove_one(struct pci_d if (BNXT_PF(bp)) bnxt_sriov_disable(bp); + pci_disable_pcie_error_reporting(pdev); + unregister_netdev(dev); clear_bit(BNXT_STATE_IN_FW_RESET, &bp->state); + /* Flush any pending tasks */ bnxt_cancel_sp_work(bp); bp->sp_event = 0; bnxt_dl_fw_reporters_destroy(bp, true); - pci_disable_pcie_error_reporting(pdev); - unregister_netdev(dev); bnxt_dl_unregister(bp); bnxt_shutdown_tc(bp); Patches currently in stable-queue which might be from vasundhara-v.volam@xxxxxxxxxxxx are queue-5.4/bnxt_en-check-abort-error-state-in-bnxt_open_nic.patch queue-5.4/bnxt_en-fix-regression-in-workqueue-cleanup-logic-in-bnxt_remove_one.patch queue-5.4/bnxt_en-re-write-pci-bars-after-pci-fatal-error.patch queue-5.4/bnxt_en-invoke-cancel_delayed_work_sync-for-pfs-also.patch queue-5.4/bnxt_en-send-hwrm_func_reset-fw-command-unconditionally.patch