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>] [day] [month] [year] [list]
Message-Id: <20251230062346.209782-1-kaushlendra.kumar@intel.com>
Date: Tue, 30 Dec 2025 11:53:46 +0530
From: Kaushlendra Kumar <kaushlendra.kumar@...el.com>
To: bhelgaas@...gle.com,
	yinghai@...nel.org
Cc: linux-kernel@...r.kernel.org,
	Kaushlendra Kumar <kaushlendra.kumar@...el.com>,
	stable@...r.kernel.org
Subject: [PATCH] eisa/pci_eisa: Fix PCI device refcount leak on early init error

The for_each_pci_dev() loop takes a reference on each PCI device
during iteration. When returning early on pci_eisa_init() failure,
the reference on 'dev' is not released, causing a resource leak.

Add pci_dev_put(dev) before the error return to properly balance
the reference count taken by for_each_pci_dev().

Fixes: c5fb301ae83b ("EISA/PCI: Init EISA early, before PNP")
Cc: stable@...r.kernel.org
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@...el.com>
---
 drivers/eisa/pci_eisa.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c
index 8173e60bb808..8242e9e16ce2 100644
--- a/drivers/eisa/pci_eisa.c
+++ b/drivers/eisa/pci_eisa.c
@@ -80,8 +80,10 @@ static int __init pci_eisa_init_early(void)
 	for_each_pci_dev(dev)
 		if ((dev->class >> 8) == PCI_CLASS_BRIDGE_EISA) {
 			ret = pci_eisa_init(dev);
-			if (ret)
+			if (ret) {
+				pci_dev_put(dev);
 				return ret;
+			}
 		}
 
 	return 0;
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ