lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250224155025.782179-2-thippeswamy.havalige@amd.com>
Date: Mon, 24 Feb 2025 21:20:22 +0530
From: Thippeswamy Havalige <thippeswamy.havalige@....com>
To: <bhelgaas@...gle.com>, <lpieralisi@...nel.org>, <kw@...ux.com>,
	<manivannan.sadhasivam@...aro.org>, <robh@...nel.org>, <krzk+dt@...nel.org>,
	<conor+dt@...nel.org>
CC: <linux-pci@...r.kernel.org>, <devicetree@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <michal.simek@....com>,
	<bharat.kumar.gogada@....com>, Thippeswamy Havalige
	<thippeswamy.havalige@....com>
Subject: [PATCH v5 1/3] PCI: xilinx-cpm: Fix IRQ domain leak in error path of probe.

The IRQ domain allocated for the PCIe controller is not freed if
resource_list_first_type returns NULL, leading to a resource leak.

This fix ensures properly cleaning up the allocated IRQ domain in the error
path.

Signed-off-by: Thippeswamy Havalige <thippeswamy.havalige@....com>
---
 drivers/pci/controller/pcie-xilinx-cpm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pcie-xilinx-cpm.c b/drivers/pci/controller/pcie-xilinx-cpm.c
index 81e8bfae53d0..660b12fc4631 100644
--- a/drivers/pci/controller/pcie-xilinx-cpm.c
+++ b/drivers/pci/controller/pcie-xilinx-cpm.c
@@ -583,8 +583,10 @@ static int xilinx_cpm_pcie_probe(struct platform_device *pdev)
 		return err;
 
 	bus = resource_list_first_type(&bridge->windows, IORESOURCE_BUS);
-	if (!bus)
+	if (!bus) {
+		xilinx_cpm_free_irq_domains(port);
 		return -ENODEV;
+	}
 
 	port->variant = of_device_get_match_data(dev);
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ