Commit 472a0d5b authored by Branislav Radocaj's avatar Branislav Radocaj Committed by Greg Kroah-Hartman

net: ethernet: arc: fix error handling in emac_rockchip_probe

[ Upstream commit e46772a6 ]

If clk_set_rate() fails, we should disable clk before return.
Found by Linux Driver Verification project (
Signed-off-by: default avatarBranislav Radocaj <>
Signed-off-by: default avatarDavid S. Miller <>
Signed-off-by: default avatarSasha Levin <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 31d3d760
......@@ -220,9 +220,11 @@ static int emac_rockchip_probe(struct platform_device *pdev)
/* RMII TX/RX needs always a rate of 25MHz */
err = clk_set_rate(priv->macclk, 25000000);
if (err)
if (err) {
"failed to change mac clock rate (%d)\n", err);
goto out_clk_disable_macclk;
err = arc_emac_probe(ndev, interface);
......@@ -232,7 +234,8 @@ static int emac_rockchip_probe(struct platform_device *pdev)
return 0;
if (priv->regulator)
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