scsi: pm8001: fix probe error-path resource leaks
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | scsi: pm8001: free IRQs when HBA allocation failsdrivers/ | +7 | 0 replies | |
| 2/4 | scsi: pm8001: clean up resources on probe failuredrivers/ | +11 | 0 replies | |
| 3/4 | scsi: pm8001: free CCB resources on allocation failuredrivers/ | +30 | 0 replies | |
| 4/4 | scsi: pm8001: free MSI-X vectors before INT-X fallbackdrivers/ | +7 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
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