From: Mitch A Williams Date: Thu, 20 Jun 2013 06:03:36 +0000 (+0000) Subject: igb: don't allow SR-IOV without MSI-X X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=502671967403c611b362836aef8cdee65e9a626a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git igb: don't allow SR-IOV without MSI-X MSI-X interrupts are required for SR-IOV operation. Check to make sure they're enabled before allowing the user to turn on VFs. Signed-off-by: Mitch Williams Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 8e7c1b83da19..94295a06c124 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -2436,6 +2436,11 @@ static int igb_enable_sriov(struct pci_dev *pdev, int num_vfs) int err = 0; int i; + if (!adapter->msix_entries) { + err = -EPERM; + goto out; + } + if (!num_vfs) goto out; else if (old_vfs && old_vfs == num_vfs)