net: qcom/emac: add missed clk_disable_unprepare in error path of emac_clks_phase1_init
Subsystems (3)
PATCH 1/1 net: qcom/emac: add missed clk_disable_unprepare in error path of emac_clks_phase1_init
Fix the missing clk_disable_unprepare() before return from emac_clks_phase1_init() in the error handling case.
Fixes b9b17debc69d ("net: emac: emac gigabit ethernet controller driver")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Wang Hai <[email protected]>
Acked-by Timur Tabi <[email protected]>
--- drivers/net/ethernet/qualcomm/emac/emac.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/net/ethernet/qualcomm/emac/emac.c +14 -3
@@ -474,13 +474,24 @@ static int emac_clks_phase1_init(struct platform_device *pdev, ret =clk_prepare_enable (adpt->clk[EMAC_CLK_CFG_AHB ]);if (ret) -return ret; + goto disable_clk_axi; ret =clk_set_rate (adpt->clk[EMAC_CLK_HIGH_SPEED ],19200000 );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 */
Signature · 1 line
2.17.1
From: Wang Hai <[email protected]>
Date: Mon, 10 Aug 2020 10:57:05 +0800
Quoted 7 lines
Fix the missing
clk_disable_unprepare()before return fromemac_clks_phase1_init()in the error handling case.Fixes b9b17debc69d ("net: emac: emac gigabit ethernet controller driver")Reported-by Hulk Robot <[email protected]>Signed-off-by Wang Hai <[email protected]>Acked-by Timur Tabi <[email protected]>
Applied, thank you.