Skip to content

Commit e928b5d

Browse files
khoroshilovdavem330
authored andcommitted
net: mv643xx_eth: disable clk on error path in mv643xx_eth_shared_probe()
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 <khoroshilov@ispras.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 97dc47a commit e928b5d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/net/ethernet/marvell/mv643xx_eth.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2879,14 +2879,19 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
28792879

28802880
ret = mv643xx_eth_shared_of_probe(pdev);
28812881
if (ret)
2882-
return ret;
2882+
goto err_put_clk;
28832883
pd = dev_get_platdata(&pdev->dev);
28842884

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

28892889
return 0;
2890+
2891+
err_put_clk:
2892+
if (!IS_ERR(msp->clk))
2893+
clk_disable_unprepare(msp->clk);
2894+
return ret;
28902895
}
28912896

28922897
static int mv643xx_eth_shared_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)