Also use new iterator to walk PCI devices of a PCI bus. Signed-off-by: Jiang Liu <jiang.liu@xxxxxxxxxx> --- drivers/pci/iov.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 5eb8165..4b796d6 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -36,19 +36,17 @@ static struct pci_bus *virtfn_add_bus(struct pci_bus *bus, int busnr) struct pci_bus *child; if (bus->number == busnr) - return bus; + return pci_bus_get(bus); - child = pci_find_bus(pci_domain_nr(bus), busnr); + child = pci_get_bus(pci_domain_nr(bus), busnr); if (child) return child; child = pci_add_new_bus(bus, NULL, busnr); - if (!child) - return NULL; - - pci_bus_insert_busn_res(child, busnr, busnr); + if (child) + pci_bus_insert_busn_res(child, busnr, busnr); - return child; + return pci_bus_get(child); } static void virtfn_remove_bus(struct pci_bus *physbus, struct pci_bus *virtbus) @@ -113,6 +111,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int reset) goto failed2; kobject_uevent(&virtfn->dev.kobj, KOBJ_CHANGE); + pci_bus_put(bus); return 0; @@ -125,6 +124,7 @@ failed1: virtfn_remove_bus(dev->bus, bus); failed0: mutex_unlock(&iov->dev->sriov->lock); + pci_bus_put(bus); return rc; } -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html