Commit 8c07205a authored by Wang Hai's avatar Wang Hai Committed by Jakub Kicinski

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: 4c2703df ("net: marvell: prestera: Add PCI interface support")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
Reviewed-by: default avatarVadym Kochan <vadym.kochan@plvision.eu>
Acked-by: default avatarVadym Kochan <vadym.kochan@plvision.eu>
Link: https://lore.kernel.org/r/20201113113236.71678-1-wanghai38@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent aa6306a8
...@@ -676,7 +676,8 @@ static int prestera_pci_probe(struct pci_dev *pdev, ...@@ -676,7 +676,8 @@ static int prestera_pci_probe(struct pci_dev *pdev,
if (err) if (err)
return 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"); dev_err(&pdev->dev, "fail to set DMA mask\n");
goto err_dma_mask; goto err_dma_mask;
} }
...@@ -702,8 +703,10 @@ static int prestera_pci_probe(struct pci_dev *pdev, ...@@ -702,8 +703,10 @@ static int prestera_pci_probe(struct pci_dev *pdev,
dev_info(fw->dev.dev, "Prestera FW is ready\n"); dev_info(fw->dev.dev, "Prestera FW is ready\n");
fw->wq = alloc_workqueue("prestera_fw_wq", WQ_HIGHPRI, 1); fw->wq = alloc_workqueue("prestera_fw_wq", WQ_HIGHPRI, 1);
if (!fw->wq) if (!fw->wq) {
err = -ENOMEM;
goto err_wq_alloc; goto err_wq_alloc;
}
INIT_WORK(&fw->evt_work, prestera_fw_evt_work_fn); INIT_WORK(&fw->evt_work, prestera_fw_evt_work_fn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment