Message ID | 1415620410-4937-2-git-send-email-sathya.perla@emulex.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index 2c6643f..6e65b47 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -477,6 +477,11 @@ static ssize_t sriov_numvfs_store(struct device *dev, } if (num_vfs == 0) { + if (pci_vfs_assigned(pdev)) { + dev_warn(&pdev->dev, "Cannot disable VFs while they are assigned\n"); + return -EBUSY; + } + /* disable VFs */ ret = pdev->driver->sriov_configure(pdev, 0); if (ret < 0)