From: Dinh Nguyen <dinguyen@kernel.org>
To: Mahesh Vaidya <mahesh.vaidya@altera.com>,
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: Fri, 24 Apr 2026 07:42:00 -0500 [thread overview]
Message-ID: <11154ecc-d49d-40cb-8437-a4e6af1420de@kernel.org> (raw)
In-Reply-To: <20260424094913.522123-3-mahesh.vaidya@altera.com>
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.
Dinh
next prev parent reply other threads:[~2026-04-24 12:42 UTC|newest]
Thread overview: 7+ 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-24 9:49 ` [PATCH 2/3] PCI: altera: fix resource leaks on probe failure Mahesh Vaidya
2026-04-24 12:42 ` Dinh Nguyen [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
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=11154ecc-d49d-40cb-8437-a4e6af1420de@kernel.org \
--to=dinguyen@kernel.org \
--cc=bhelgaas@google.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.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=mahesh.vaidya@altera.com \
--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