Skip to content

Commit

Permalink
net: marvell: prestera: fix error return code in prestera_pci_probe()
Browse files Browse the repository at this point in the history
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 <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Reviewed-by: Vadym Kochan <vadym.kochan@plvision.eu>
Acked-by: Vadym Kochan <vadym.kochan@plvision.eu>
Link: https://lore.kernel.org/r/20201113113236.71678-1-wanghai38@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Wang Hai authored and Jakub Kicinski committed Nov 13, 2020
1 parent aa6306a commit 8c07205
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/ethernet/marvell/prestera/prestera_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,8 @@ static int prestera_pci_probe(struct pci_dev *pdev,
if (err)
return err;

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

fw->wq = alloc_workqueue("prestera_fw_wq", WQ_HIGHPRI, 1);
if (!fw->wq)
if (!fw->wq) {
err = -ENOMEM;
goto err_wq_alloc;
}

INIT_WORK(&fw->evt_work, prestera_fw_evt_work_fn);

Expand Down

0 comments on commit 8c07205

Please sign in to comment.