diff options
author | Chengguang Xu <cgxu519@mykernel.net> | 2022-05-29 16:34:56 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-06-20 10:30:36 +0100 |
commit | 8cc7b3d329f76bd359860b8caef2c36157ceeb16 (patch) | |
tree | 5b6c7a67781185075d601f4dbbe240868b90bc2f /drivers/media/platform/samsung | |
parent | 5455491bf13f6f7d5e337aada51bbfa43842df93 (diff) |
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: Chengguang Xu <cgxu519@mykernel.net>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/samsung')
-rw-r--r-- | drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c index 72a901e99450..187849841a28 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c @@ -88,7 +88,6 @@ int s5p_mfc_power_on(void) if (ret < 0) { mfc_err("clock prepare failed for clock: %s\n", pm->clk_names[i]); - i++; goto err; } } @@ -98,7 +97,7 @@ int s5p_mfc_power_on(void) return 0; err: - while (--i > 0) + while (--i >= 0) clk_disable_unprepare(pm->clocks[i]); pm_runtime_put(pm->device); return ret; |