]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ionic: no double destroy workqueue
authorShannon Nelson <shannon.nelson@amd.com>
Thu, 12 Dec 2024 21:31:56 +0000 (13:31 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Dec 2024 13:02:03 +0000 (14:02 +0100)
commit13355dd37e22edbcb99c599f783233188740a650
tree4fc7bfba11dc910e270fc082c44f2a93db0a91ee
parentee2e931b2b46de9af7f681258e8ec8e2cd81cfc6
ionic: no double destroy workqueue

[ Upstream commit 746e6ae2e202b062b9deee7bd86d94937997ecd7 ]

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: 9e25450da700 ("ionic: add private workqueue per-device")
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20241212213157.12212-3-shannon.nelson@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/pensando/ionic/ionic_dev.c