Commit c08be09b authored by Wang Hai's avatar Wang Hai Committed by Greg Kroah-Hartman

net: qcom/emac: add missed clk_disable_unprepare in error path of emac_clks_phase1_init

[ Upstream commit 50caa777 ]

Fix the missing clk_disable_unprepare() before return
from emac_clks_phase1_init() in the error handling case.

Fixes: b9b17deb ("net: emac: emac gigabit ethernet controller driver")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
Acked-by: default avatarTimur Tabi <timur@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent ae71f731
...@@ -493,13 +493,24 @@ static int emac_clks_phase1_init(struct platform_device *pdev, ...@@ -493,13 +493,24 @@ static int emac_clks_phase1_init(struct platform_device *pdev,
ret = clk_prepare_enable(adpt->clk[EMAC_CLK_CFG_AHB]); ret = clk_prepare_enable(adpt->clk[EMAC_CLK_CFG_AHB]);
if (ret) if (ret)
return ret; goto disable_clk_axi;
ret = clk_set_rate(adpt->clk[EMAC_CLK_HIGH_SPEED], 19200000); ret = clk_set_rate(adpt->clk[EMAC_CLK_HIGH_SPEED], 19200000);
if (ret) if (ret)
return ret; goto disable_clk_cfg_ahb;
ret = clk_prepare_enable(adpt->clk[EMAC_CLK_HIGH_SPEED]);
if (ret)
goto disable_clk_cfg_ahb;
return clk_prepare_enable(adpt->clk[EMAC_CLK_HIGH_SPEED]); return 0;
disable_clk_cfg_ahb:
clk_disable_unprepare(adpt->clk[EMAC_CLK_CFG_AHB]);
disable_clk_axi:
clk_disable_unprepare(adpt->clk[EMAC_CLK_AXI]);
return ret;
} }
/* Enable clocks; needs emac_clks_phase1_init to be called before */ /* Enable clocks; needs emac_clks_phase1_init to be called before */
......
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