]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PCI: keystone: Use devm_request_irq() to free "ks-pcie-error-irq" on exit
authorSiddharth Vadapalli <s-vadapalli@ti.com>
Fri, 12 Sep 2025 10:07:58 +0000 (15:37 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 12:59:54 +0000 (13:59 +0100)
commit e51d05f523e43ce5d2bad957943a2b14f68078cd upstream.

Commit under Fixes introduced the IRQ handler for "ks-pcie-error-irq".
The interrupt is acquired using "request_irq()" but is never freed if
the driver exits due to an error. Although the section in the driver that
invokes "request_irq()" has moved around over time, the issue hasn't been
addressed until now.

Fix this by using "devm_request_irq()" which automatically frees the
interrupt if the driver exits.

Fixes: 025dd3daeda7 ("PCI: keystone: Add error IRQ handler")
Reported-by: Jiri Slaby <jirislaby@kernel.org>
Closes: https://lore.kernel.org/r/3d3a4b52-e343-42f3-9d69-94c259812143@kernel.org
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20250912100802.3136121-2-s-vadapalli@ti.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/controller/dwc/pci-keystone.c

index b28d3c4205fe44798b80e3ac49a16e895784dad5..0a12fbcd29df5ddd7bb006079b8363f89ea076c9 100644 (file)
@@ -1294,8 +1294,8 @@ static int ks_pcie_probe(struct platform_device *pdev)
                return irq;
        }
 
-       ret = request_irq(irq, ks_pcie_err_irq_handler, IRQF_SHARED,
-                         "ks-pcie-error-irq", ks_pcie);
+       ret = devm_request_irq(dev, irq, ks_pcie_err_irq_handler, IRQF_SHARED,
+                              "ks-pcie-error-irq", ks_pcie);
        if (ret < 0) {
                dev_err(dev, "failed to request error IRQ %d\n",
                        irq);