From: Jacob Keller <jacob.e.kel...@intel.com>

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.kel...@intel.com>
Tested-by: Krishneil Singh <krishneil.k.si...@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirs...@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c 
b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
index c85fc9894..f72d1ca 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c
@@ -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 */
-- 
2.5.5

Reply via email to