Skip to content

Commit

Permalink
net: mv643xx_eth: disable clk on error path in mv643xx_eth_shared_pro…
Browse files Browse the repository at this point in the history
…be()

If mv643xx_eth_shared_of_probe() fails, mv643xx_eth_shared_probe()
leaves clk enabled.

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 17, 2019
1 parent 97dc47a commit e928b5d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/ethernet/marvell/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2879,14 +2879,19 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)

ret = mv643xx_eth_shared_of_probe(pdev);
if (ret)
return ret;
goto err_put_clk;
pd = dev_get_platdata(&pdev->dev);

msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ?
pd->tx_csum_limit : 9 * 1024;
infer_hw_params(msp);

return 0;

err_put_clk:
if (!IS_ERR(msp->clk))
clk_disable_unprepare(msp->clk);
return ret;
}

static int mv643xx_eth_shared_remove(struct platform_device *pdev)
Expand Down

0 comments on commit e928b5d

Please sign in to comment.