Skip to content

Commit 6dce38b

Browse files
tititiou36davem330
authored andcommitted
gve: Propagate error codes to caller
If 'gve_probe()' fails, we should propagate the error code, instead of hard coding a -ENXIO value. Make sure that all error handling paths set a correct value for 'err'. Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Catherine Sullivan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2342ae1 commit 6dce38b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ethernet/google/gve/gve_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,7 +1469,7 @@ static int gve_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
14691469

14701470
err = pci_enable_device(pdev);
14711471
if (err)
1472-
return -ENXIO;
1472+
return err;
14731473

14741474
err = pci_request_regions(pdev, "gvnic-cfg");
14751475
if (err)
@@ -1512,6 +1512,7 @@ static int gve_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
15121512
dev = alloc_etherdev_mqs(sizeof(*priv), max_tx_queues, max_rx_queues);
15131513
if (!dev) {
15141514
dev_err(&pdev->dev, "could not allocate netdev\n");
1515+
err = -ENOMEM;
15151516
goto abort_with_db_bar;
15161517
}
15171518
SET_NETDEV_DEV(dev, &pdev->dev);
@@ -1593,7 +1594,7 @@ static int gve_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
15931594

15941595
abort_with_enabled:
15951596
pci_disable_device(pdev);
1596-
return -ENXIO;
1597+
return err;
15971598
}
15981599

15991600
static void gve_remove(struct pci_dev *pdev)

0 commit comments

Comments
 (0)