Commit 8cc7b3d3 authored by Chengguang Xu's avatar Chengguang Xu Committed by Mauro Carvalho Chehab

media: platform: fix missing/incorrect resource cleanup in error case

In error case of s5p_mfc_power_on() we should call
clk_disable_unprepare() for the
clocks(from pm->clocks[0] to pm->clocks[i-1]).
Signed-off-by: default avatarChengguang Xu <cgxu519@mykernel.net>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 5455491b
...@@ -88,7 +88,6 @@ int s5p_mfc_power_on(void) ...@@ -88,7 +88,6 @@ int s5p_mfc_power_on(void)
if (ret < 0) { if (ret < 0) {
mfc_err("clock prepare failed for clock: %s\n", mfc_err("clock prepare failed for clock: %s\n",
pm->clk_names[i]); pm->clk_names[i]);
i++;
goto err; goto err;
} }
} }
...@@ -98,7 +97,7 @@ int s5p_mfc_power_on(void) ...@@ -98,7 +97,7 @@ int s5p_mfc_power_on(void)
return 0; return 0;
err: err:
while (--i > 0) while (--i >= 0)
clk_disable_unprepare(pm->clocks[i]); clk_disable_unprepare(pm->clocks[i]);
pm_runtime_put(pm->device); pm_runtime_put(pm->device);
return ret; return ret;
......
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