Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/4] scsi: pm8001: fix probe error-path resource leaks
@ 2026-09-11  9:10 Peng Hao
  2026-09-11  9:10 ` [PATCH 1/4] scsi: pm8001: free IRQs when HBA allocation fails Peng Hao
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Peng Hao @ 2026-09-11  9:10 UTC (permalink / raw)
  To: jinpu.wang, James.Bottomley; +Cc: linux-scsi

Following the fix for the incorrect IRQ index used while unwinding a
partial MSI-X setup, further review found several related resource
lifetime issues in the pm8001 initialization and probe error paths.

An allocation failure after IRQ registration can leave handlers active
after their HBA data has been freed. Other probe failures bypass parts of
the normal teardown sequence and leak tasklets, SAS host allocations,
CCB resources, or the devices array. In addition, falling back from MSI-X
to INT-X leaves the allocated MSI-X vectors and multi-queue state behind.

This series makes the error-path ownership and teardown ordering
consistent:

  - release registered IRQs before destroying their HBA and tasklet data;
  - route failures after controller initialization through chip reset and
    the complete probe cleanup chain;
  - centralize CCB teardown so both partial allocation failures and normal
    HBA destruction release all CCB-related resources;
  - release MSI-X vectors and restore single-queue state before requesting
    the legacy INT-X interrupt.

Peng Hao (4):
  scsi: pm8001: free IRQs when HBA allocation fails
  scsi: pm8001: clean up resources on probe failure
  scsi: pm8001: free CCB resources on allocation failure
  scsi: pm8001: free MSI-X vectors before INT-X fallback

 drivers/scsi/pm8001/pm8001_init.c | 88 ++++++++++++++++++++++++---------------
 1 file changed, 55 insertions(+), 33 deletions(-)

-- 
2.43.7

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

end of thread, other threads:[~2026-09-11  9:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11  9:10 [PATCH 0/4] scsi: pm8001: fix probe error-path resource leaks Peng Hao
2026-09-11  9:10 ` [PATCH 1/4] scsi: pm8001: free IRQs when HBA allocation fails Peng Hao
2026-09-11  9:26   ` sashiko-bot
2026-09-11  9:10 ` [PATCH 2/4] scsi: pm8001: clean up resources on probe failure Peng Hao
2026-09-11  9:25   ` sashiko-bot
2026-09-11  9:10 ` [PATCH 3/4] scsi: pm8001: free CCB resources on allocation failure Peng Hao
2026-09-11  9:26   ` sashiko-bot
2026-09-11  9:10 ` [PATCH 4/4] scsi: pm8001: free MSI-X vectors before INT-X fallback Peng Hao
2026-09-11  9:31   ` sashiko-bot

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