Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] scsi: ppa: cancel delayed work before freeing on detach
@ 2026-10-19 16:38 Tristan Madani
  2026-10-19 16:47 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Tristan Madani @ 2026-10-19 16:38 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K . Petersen
  Cc: David Howells, linux-scsi, stable, Tristan Madani

From: Tristan Madani <tristan@talencesecurity.com>

ppa_detach() frees the ppa_struct without cancelling the pending
delayed work ppa_tq. If ppa_interrupt() is still scheduled or running
when the struct is freed, the work function accesses freed memory via
container_of().

Add cancel_delayed_work_sync() before teardown, matching the pattern
in the sibling imm driver.

Fixes: c4028958b6eca ("WorkStruct: make allyesconfig")
Cc: stable@vger.kernel.org
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
---
 drivers/scsi/ppa.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index 8a4e910d5758f..7f4b2a4157725 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -1136,6 +1136,7 @@ static void ppa_detach(struct parport *pb)
 	ppa_struct *dev;
 	list_for_each_entry(dev, &ppa_hosts, list) {
 		if (dev->dev->port == pb) {
+			cancel_delayed_work_sync(&dev->ppa_tq);
 			list_del_init(&dev->list);
 			scsi_remove_host(dev->host);
 			scsi_host_put(dev->host);
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-19 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 16:38 [PATCH] scsi: ppa: cancel delayed work before freeing on detach Tristan Madani
2026-10-19 16:47 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox