fm10k: return proper error code when pci_enable_msix_range fails
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 7 Jun 2016 23:09:01 +0000 (16:09 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 20 Jul 2016 22:22:16 +0000 (15:22 -0700)
The pci_enable_msix_range() function returns a positive value of the
number of allocated vectors if it succeeds. On failure it returns
a negative error code. Return this code properly so that the error
message printed by the driver will show the actual error code instead of
being masked by -ENOMEM.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/fm10k/fm10k_main.c

index c85fc98945fa7921909705b42bcaf6674b56148c..f72d1cae10ffab479fb870a0889134eb57f0d919 100644 (file)
@@ -1858,7 +1858,7 @@ static int fm10k_init_msix_capability(struct fm10k_intfc *interface)
        if (v_budget < 0) {
                kfree(interface->msix_entries);
                interface->msix_entries = NULL;
-               return -ENOMEM;
+               return v_budget;
        }
 
        /* record the number of queues available for q_vectors */