[PATCH] qed: drain slowpath tasklets during teardown

From: Jiale Yao

Date: Wed Oct 28 2026 - 00:57:37 EST


qed_nic_stop() disables each slowpath tasklet before freeing the
interrupt and status block resources. Disabling waits for a running
tasklet, but it does not remove a pending tasklet from the tasklet
queue. A pending tasklet can therefore retain a pointer to the freed
qed_hwfn and its status blocks.

Kill the tasklet during the final slowpath teardown so pending work is
removed before the resources it accesses are released.

Fixes: fe56b9e6a8d9 ("qed: Add module with basic common support")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
---
drivers/net/ethernet/qlogic/qed/qed_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c
index 28a8a2b9d501..abe8a841b277 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_main.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_main.c
@@ -833,10 +833,10 @@ static int qed_nic_stop(struct qed_dev *cdev)
struct qed_hwfn *p_hwfn = &cdev->hwfns[i];

if (p_hwfn->b_sp_dpc_enabled) {
- tasklet_disable(&p_hwfn->sp_dpc);
+ tasklet_kill(&p_hwfn->sp_dpc);
p_hwfn->b_sp_dpc_enabled = false;
DP_VERBOSE(cdev, NETIF_MSG_IFDOWN,
- "Disabled sp tasklet [hwfn %d] at %p\n",
+ "Killed sp tasklet [hwfn %d] at %p\n",
i, &p_hwfn->sp_dpc);
}
}
--
2.34.1