net: marvell: prestera: fix error return code in prestera_pci_probe()
Subsystems (3)
PATCH 1/1 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.
--- drivers/net/ethernet/marvell/prestera/prestera_pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/prestera/prestera_pci.c +5 -2
@@ -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; }
@@ -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);
Signature · 1 line
2.17.1
Hi Wang,
Quoted 25 lines · Wang Hai
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
Fixes 4c2703dfd7fa ("net: marvell: prestera: Add PCI interface support")Reported-by Hulk Robot <[email protected]>Signed-off-by Wang Hai <[email protected]>--- drivers/net/ethernet/marvell/prestera/prestera_pci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/net/ethernet/marvell/prestera/prestera_pci.c +2
-1@@ -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; }
drivers/net/ethernet/marvell/prestera/prestera_pci.c static int prestera_pci_probe(struct pci_dev *pdev, · line 711
Quoted 10 lines
drivers/net/ethernet/marvell/prestera/prestera_pci.c +3
-1@@ -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);
Thank you!
Just in case it is needed:
This patch was applied to netdev/net.git (refs/heads/master):
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
Quoted 8 lines · On Fri, 13 Nov 2020 19:32:36 +0800 you wrote:
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
Fixes 4c2703dfd7fa ("net: marvell: prestera: Add PCI interface support")Reported-by Hulk Robot <[email protected]>Signed-off-by Wang Hai <[email protected]>[...]
Here is the summary with links:
- [net] net: marvell: prestera: fix error return code in prestera_pci_probe()
https://git.kernel.org/netdev/net/c/8c07205aea36
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html