Skip to content

Commit

Permalink
stmmac: don't return zero on failure path in stmmac_pci_probe()
Browse files Browse the repository at this point in the history
If stmmac_dvr_probe() fails in stmmac_pci_probe(), it breaks off initialization,
deallocates all resources, but returns zero.
The patch adds -ENODEV as return value in this case.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
khoroshilov authored and davem330 committed Feb 3, 2013
1 parent 33397a7 commit 4f46385
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat, addr);
if (!priv) {
pr_err("%s: main driver probe failed", __func__);
ret = -ENODEV;
goto err_out;
}
priv->dev->irq = pdev->irq;
Expand Down

0 comments on commit 4f46385

Please sign in to comment.