Skip to content

scsi: pm8001: fix probe error-path resource leaks

Peng Hao linux-scsi 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4scsi: pm8001: free IRQs when HBA allocation failsdrivers/scsi/pm8001/pm8001_init.c+7 -180 replies
2/4scsi: pm8001: clean up resources on probe failuredrivers/scsi/pm8001/pm8001_init.c+11 -30 replies
3/4scsi: pm8001: free CCB resources on allocation failuredrivers/scsi/pm8001/pm8001_init.c+30 -120 replies
4/4scsi: pm8001: free MSI-X vectors before INT-X fallbackdrivers/scsi/pm8001/pm8001_init.c+7 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] scsi: pm8001: fix probe error-path resource leaks

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(-)
Signature · 1 line
2.43.7