提交 e46772a6 编写于 作者: B Branislav Radocaj 提交者: David S. Miller

net: ethernet: arc: fix error handling in emac_rockchip_probe

If clk_set_rate() fails, we should disable clk before return.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: NBranislav Radocaj <branislav@radocaj.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 589bf32f
...@@ -220,9 +220,11 @@ static int emac_rockchip_probe(struct platform_device *pdev) ...@@ -220,9 +220,11 @@ static int emac_rockchip_probe(struct platform_device *pdev)
/* RMII TX/RX needs always a rate of 25MHz */ /* RMII TX/RX needs always a rate of 25MHz */
err = clk_set_rate(priv->macclk, 25000000); err = clk_set_rate(priv->macclk, 25000000);
if (err) if (err) {
dev_err(dev, dev_err(dev,
"failed to change mac clock rate (%d)\n", err); "failed to change mac clock rate (%d)\n", err);
goto out_clk_disable_macclk;
}
} }
err = arc_emac_probe(ndev, interface); err = arc_emac_probe(ndev, interface);
...@@ -232,7 +234,8 @@ static int emac_rockchip_probe(struct platform_device *pdev) ...@@ -232,7 +234,8 @@ static int emac_rockchip_probe(struct platform_device *pdev)
} }
return 0; return 0;
out_clk_disable_macclk:
clk_disable_unprepare(priv->macclk);
out_regulator_disable: out_regulator_disable:
if (priv->regulator) if (priv->regulator)
regulator_disable(priv->regulator); regulator_disable(priv->regulator);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册