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-next>] [day] [month] [year] [list]
Date:	Thu, 30 May 2013 13:45:34 +0800
From:	Xudong Hao <xudong.hao@...el.com>
To:	bhelgaas@...gle.com
Cc:	yinghai@...nel.org, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org, Xudong Hao <xudong.hao@...el.com>
Subject: [PATCH] PCI: set correct value for iov device before device

Since device registering is put into pci_device_add(), it must set value of
Virtual Function device's member before the pci_dev is put to device tree. Or
some relevant subsystem of driver model such as xen will report a incorrect
IOV device to Xen hypervior.

Signed-off-by: Xudong Hao <xudong.hao@...el.com>
---
 drivers/pci/iov.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index c93071d..43d3de9 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -110,12 +110,12 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset)
 	if (reset)
 		__pci_reset_function(virtfn);
 
-	pci_device_add(virtfn, virtfn->bus);
-	mutex_unlock(&iov->dev->sriov->lock);
-
 	virtfn->physfn = pci_dev_get(dev);
 	virtfn->is_virtfn = 1;
 
+	pci_device_add(virtfn, virtfn->bus);
+	mutex_unlock(&iov->dev->sriov->lock);
+
 	rc = pci_bus_add_device(virtfn);
 	sprintf(buf, "virtfn%u", id);
 	rc = sysfs_create_link(&dev->dev.kobj, &virtfn->dev.kobj, buf);
-- 
1.7.12.1

--
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