Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] scsi: pm8001: unwind the probe on ccb tag allocation failure
@ 2026-11-04  2:14 Wentao Liang
  2026-11-04  2:26 ` sashiko-bot
  2026-11-04  8:33 ` Jinpu Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Wentao Liang @ 2026-11-04  2:14 UTC (permalink / raw)
  To: Jack Wang, James E.J. Bottomley, Martin K. Petersen; +Cc: linux-scsi

pm8001_init_ccb_tag() is called after the Scsi_Host, the sas_ha and the
driver's private data have been allocated, and after the PCI regions
have been requested.  When it fails, pm8001_pci_probe() jumps to
err_out_enable, which only returns the error: the Scsi_Host, sas_ha and
private data are leaked, the PCI regions stay requested and the device
stays enabled.

Jump to err_out_ha_free instead, which releases all of those resources.

Fixes: 5a141315ed7c ("scsi: pm80xx: Increase the number of outstanding I/O supported to 1024")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/scsi/pm8001/pm8001_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 5af81c73a8f8..389649b36aab 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -1178,7 +1178,7 @@ static int pm8001_pci_probe(struct pci_dev *pdev,
 
 	rc = pm8001_init_ccb_tag(pm8001_ha);
 	if (rc)
-		goto err_out_enable;
+		goto err_out_ha_free;
 
 
 	PM8001_CHIP_DISP->chip_post_init(pm8001_ha);
-- 
2.34.1


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

end of thread, other threads:[~2026-11-05  5:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04  2:14 [PATCH] scsi: pm8001: unwind the probe on ccb tag allocation failure Wentao Liang
2026-11-04  2:26 ` sashiko-bot
2026-11-04  8:33 ` Jinpu Wang
2026-11-04  8:41   ` Krzysztof Kozlowski
2026-11-04  9:43     ` Jinpu Wang
2026-11-05  5:51     ` Wentao Liang

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