igb: clean up in all error paths when enabling SR-IOV
[sfrench/cifs-2.6.git] / drivers / net / ethernet / intel / igb / igb_main.c
index 13ba9c74bd848e5eb26248abc378776a3cc1fc96..76b34cee1da3c8d9a18d3254be5b88f79882ff53 100644 (file)
@@ -3827,8 +3827,11 @@ static int igb_enable_sriov(struct pci_dev *pdev, int num_vfs, bool reinit)
        }
 
        /* only call pci_enable_sriov() if no VFs are allocated already */
-       if (!old_vfs)
+       if (!old_vfs) {
                err = pci_enable_sriov(pdev, adapter->vfs_allocated_count);
+               if (err)
+                       goto err_out;
+       }
 
        goto out;