Re: [PATCH v3, part1 09/10] PCI, IOV: simplify IOV implementation

From: Liu Jiang
Date: Tue May 28 2013 - 10:50:50 EST


On Tue 28 May 2013 10:00:26 AM CST, Yinghai Lu wrote:
> On Sat, May 25, 2013 at 6:48 AM, Jiang Liu <liuj97@xxxxxxxxx> wrote:
>> Trivial changes to IOV:
....
>> @@ -136,7 +123,8 @@ failed1:
>> pci_dev_put(dev);
>> mutex_lock(&iov->dev->sriov->lock);
>> pci_stop_and_remove_bus_device(virtfn);
>> - virtfn_remove_bus(dev->bus, virtfn_bus(dev, id));
>> + virtfn_remove_bus(dev->bus, bus);
>> +failed0:
>
> need to swap above two lines. otherwise virtual bus could not be removed.
Hi Yinghai,
Good catch, will merge following patch in next version.

diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 3e33499..bf0a32e 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -123,8 +123,9 @@ failed1:
pci_dev_put(dev);
mutex_lock(&iov->dev->sriov->lock);
pci_stop_and_remove_bus_device(virtfn);
- virtfn_remove_bus(dev->bus, bus);
failed0:
+ if (bus)
+ virtfn_remove_bus(dev->bus, bus);
mutex_unlock(&iov->dev->sriov->lock);

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