public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Mahesh Vaidya <mahesh.vaidya@altera.com>
To: Dinh Nguyen <dinguyen@kernel.org>,
	joyce.ooi@intel.com, lpieralisi@kernel.org,
	kwilczynski@kernel.org, mani@kernel.org, robh@kernel.org,
	bhelgaas@google.com, krzk+dt@kernel.org, conor+dt@kernel.org
Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, subhransu.sekhar.prusty@altera.com
Subject: Re: [PATCH 2/3] PCI: altera: fix resource leaks on probe failure
Date: Mon, 27 Apr 2026 18:06:16 +0530	[thread overview]
Message-ID: <45d7bdf6-3780-4bcd-a9b2-5c6ec9ffbbe8@altera.com> (raw)
In-Reply-To: <11154ecc-d49d-40cb-8437-a4e6af1420de@kernel.org>



On 24-04-2026 18:12, Dinh Nguyen wrote:
> Hi Mahesh,
> 
> On 4/24/26 04:49, Mahesh Vaidya wrote:
>> The chained IRQ handler is installed in altera_pcie_parse_dt() but
>> never unregistered on probe failure. If any subsequent step in
>> altera_pcie_probe() fails, devm frees the pcie struct while the
>> handler still references it. A subsequent interrupt would trigger
>> a use-after-free.
>>
>> The INTx IRQ domain created in altera_pcie_init_irq_domain() is
>> similarly leaked on probe failure, since the existing cleanup via
>> altera_pcie_irq_teardown() is only invoked from the remove path.
>>
>> Move the handler installation from altera_pcie_parse_dt() into
>> altera_pcie_probe() after the IRQ domain is created, and add a
>> goto-based error path so altera_pcie_irq_teardown() is called on
>> any failure after handler installation.
>>
>> Fixes: 60f2ee5f1472 ("PCI: altera: Add Agilex support")
>> Signed-off-by: Mahesh Vaidya <mahesh.vaidya@altera.com>
>> ---
>>   drivers/pci/controller/pcie-altera.c | 17 +++++++++++++++--
>>   1 file changed, 15 insertions(+), 2 deletions(-)
>>
> I think you should decouple this patch from this series.
Sure, agree.
> 
> Dinh


  reply	other threads:[~2026-04-27 12:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24  9:49 [PATCH 0/3] PCI: altera: Add Agilex 5 PCIe Root Port support Mahesh Vaidya
2026-04-24  9:49 ` [PATCH 1/3] dt-bindings: PCI: altera: add binding for Agilex 5 Mahesh Vaidya
2026-04-25 10:22   ` Krzysztof Kozlowski
2026-04-27 12:43     ` Mahesh Vaidya
2026-04-24  9:49 ` [PATCH 2/3] PCI: altera: fix resource leaks on probe failure Mahesh Vaidya
2026-04-24 12:42   ` Dinh Nguyen
2026-04-27 12:36     ` Mahesh Vaidya [this message]
2026-04-24  9:49 ` [PATCH 3/3] PCI: altera: add Agilex 5 support Mahesh Vaidya
2026-04-24 15:48   ` Bjorn Helgaas
2026-04-27 12:49     ` Mahesh Vaidya

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=45d7bdf6-3780-4bcd-a9b2-5c6ec9ffbbe8@altera.com \
    --to=mahesh.vaidya@altera.com \
    --cc=bhelgaas@google.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@kernel.org \
    --cc=joyce.ooi@intel.com \
    --cc=krzk+dt@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=robh@kernel.org \
    --cc=subhransu.sekhar.prusty@altera.com \
    /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