Skip to content

Commit f13570e

Browse files
Yang Yingliangthierryreding
authored andcommitted
clk: tegra: tegra124-emc: Fix clock imbalance in emc_set_timing()
After calling clk_prepare_enable(), clk_disable_unprepare() needs be called when prepare_timing_change() failed. Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent e848eda commit f13570e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/clk/tegra/clk-tegra124-emc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,10 @@ static int emc_set_timing(struct tegra_clk_emc *tegra,
249249
div = timing->parent_rate / (timing->rate / 2) - 2;
250250

251251
err = tegra->prepare_timing_change(emc, timing->rate);
252-
if (err)
252+
if (err) {
253+
clk_disable_unprepare(timing->parent);
253254
return err;
255+
}
254256

255257
spin_lock_irqsave(tegra->lock, flags);
256258

0 commit comments

Comments
 (0)