Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Peng Hao <flyingpenghao@gmail.com>
To: jinpu.wang@cloud.ionos.com, James.Bottomley@HansenPartnership.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH 0/4] scsi: pm8001: fix probe error-path resource leaks
Date: Fri, 11 Sep 2026 17:10:07 +0800	[thread overview]
Message-ID: <20260911091011.94676-1-flyingpeng@tencent.com> (raw)

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

             reply	other threads:[~2026-09-11  9:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11  9:10 Peng Hao [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260911091011.94676-1-flyingpeng@tencent.com \
    --to=flyingpenghao@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox