Skip to content

Commit 746e6ae

Browse files
emuslnkuba-moo
authored andcommitted
ionic: no double destroy workqueue
There are some FW error handling paths that can cause us to try to destroy the workqueue more than once, so let's be sure we're checking for that. The case where this popped up was in an AER event where the handlers got called in such a way that ionic_reset_prepare() and thus ionic_dev_teardown() got called twice in a row. The second time through the workqueue was already destroyed, and destroy_workqueue() choked on the bad wq pointer. We didn't hit this in AER handler testing before because at that time we weren't using a private workqueue. Later we replaced the use of the system workqueue with our own private workqueue but hadn't rerun the AER handler testing since then. Fixes: 9e25450 ("ionic: add private workqueue per-device") Signed-off-by: Shannon Nelson <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9590d32 commit 746e6ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/pensando/ionic/ionic_dev.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,10 @@ void ionic_dev_teardown(struct ionic *ionic)
277277
idev->phy_cmb_pages = 0;
278278
idev->cmb_npages = 0;
279279

280-
destroy_workqueue(ionic->wq);
280+
if (ionic->wq) {
281+
destroy_workqueue(ionic->wq);
282+
ionic->wq = NULL;
283+
}
281284
mutex_destroy(&idev->cmb_inuse_lock);
282285
}
283286

0 commit comments

Comments
 (0)