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]
Date:	Wed, 28 Jan 2009 14:59:07 -0700
From:	Alex Chiang <achiang@...com>
To:	jbarnes@...tuousgeek.org
Cc:	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	Alex Chiang <achiang@...com>
Subject: [RFC PATCH 01/10] PCI: don't scan existing devices

pci_scan_slot is supposed to add newly discovered devices to
pci_bus->devices, but doesn't check to see if the device has
already been added. This can cause problems if we ever want
to use this interface to rescan the PCI bus.

Signed-off-by: Alex Chiang <achiang@...com>
---

 drivers/pci/probe.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 55ec44a..a9e17e2 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1035,6 +1035,17 @@ int pci_scan_slot(struct pci_bus *bus, int devfn)
 	for (func = 0; func < 8; func++, devfn++) {
 		struct pci_dev *dev;
 
+		dev = pci_get_slot(bus, devfn);
+		if (dev) {
+			if (dev->multifunction) {
+				pci_dev_put(dev);
+				continue;
+			} else {
+				pci_dev_put(dev);
+				break;
+			}
+		}
+
 		dev = pci_scan_single_device(bus, devfn);
 		if (dev) {
 			nr++;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ