Skip to content

Commit 8c07205

Browse files
Wang Haikuba-moo
authored andcommitted
net: marvell: prestera: fix error return code in prestera_pci_probe()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 4c2703d ("net: marvell: prestera: Add PCI interface support") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Wang Hai <[email protected]> Reviewed-by: Vadym Kochan <[email protected]> Acked-by: Vadym Kochan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent aa6306a commit 8c07205

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/net/ethernet/marvell/prestera/prestera_pci.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,8 @@ static int prestera_pci_probe(struct pci_dev *pdev,
676676
if (err)
677677
return err;
678678

679-
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(30))) {
679+
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(30));
680+
if (err) {
680681
dev_err(&pdev->dev, "fail to set DMA mask\n");
681682
goto err_dma_mask;
682683
}
@@ -702,8 +703,10 @@ static int prestera_pci_probe(struct pci_dev *pdev,
702703
dev_info(fw->dev.dev, "Prestera FW is ready\n");
703704

704705
fw->wq = alloc_workqueue("prestera_fw_wq", WQ_HIGHPRI, 1);
705-
if (!fw->wq)
706+
if (!fw->wq) {
707+
err = -ENOMEM;
706708
goto err_wq_alloc;
709+
}
707710

708711
INIT_WORK(&fw->evt_work, prestera_fw_evt_work_fn);
709712

0 commit comments

Comments
 (0)