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: <20211029200319.23475-5-jim2101024@gmail.com>
Date:   Fri, 29 Oct 2021 16:03:12 -0400
From:   Jim Quinlan <jim2101024@...il.com>
To:     linux-pci@...r.kernel.org,
        Nicolas Saenz Julienne <nsaenz@...nel.org>,
        Rob Herring <robh@...nel.org>, Mark Brown <broonie@...nel.org>,
        bcm-kernel-feedback-list@...adcom.com, jim2101024@...il.com,
        james.quinlan@...adcom.com
Cc:     Bjorn Helgaas <bhelgaas@...gle.com>,
        linux-kernel@...r.kernel.org (open list)
Subject: [PATCH v6 4/9] PCI: separate device_initialize() from pci_device_add()

Do this so that device_initialize() may be called separately
(to prepare for an imminent commit).  This change does reverse
the invocation of these calls:

	pci_configure_device(dev);
	device_initialize(&dev->dev)
to
	device_initialize(&dev->dev)
	pci_configure_device(dev);

I reviewed this and didn't see any issue but it deserves mentioning.

Signed-off-by: Jim Quinlan <jim2101024@...il.com>
---
 drivers/pci/iov.c   | 1 +
 drivers/pci/probe.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index dafdc652fcd0..baf5c1af47de 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -292,6 +292,7 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id)
 		BUG_ON(rc);
 	}
 
+	device_initialize(&virtfn->dev);
 	pci_device_add(virtfn, virtfn->bus);
 	rc = pci_iov_sysfs_link(dev, virtfn, id);
 	if (rc)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f3fc807b4fe8..0f092882b33f 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2391,6 +2391,7 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
 		kfree(dev);
 		return NULL;
 	}
+	device_initialize(&dev->dev);
 	pci_device_add(dev, bus);
 
 	return dev;
@@ -2491,7 +2492,6 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
 
 	pci_configure_device(dev);
 
-	device_initialize(&dev->dev);
 	dev->dev.release = pci_release_dev;
 
 	set_dev_node(&dev->dev, pcibus_to_node(bus));
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ