]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cavium: Return negative value when pci_alloc_irq_vectors() fails
authorZheyu Ma <zheyuma97@gmail.com>
Mon, 18 Oct 2021 02:16:22 +0000 (02:16 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2021 12:46:02 +0000 (13:46 +0100)
During the process of driver probing, the probe function should return < 0
for failure, otherwise, the kernel will treat value > 0 as success.

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/thunder/nic_main.c

index 691e1475d55e4eb24fa8a774bebf89af75d1487c..0fbecd093fa1f049ff0445feb61921a8c06291e7 100644 (file)
@@ -1193,7 +1193,7 @@ static int nic_register_interrupts(struct nicpf *nic)
                dev_err(&nic->pdev->dev,
                        "Request for #%d msix vectors failed, returned %d\n",
                           nic->num_vec, ret);
-               return 1;
+               return ret;
        }
 
        /* Register mailbox interrupt handler */