Message ID | 20220529153456.4183738-5-cgxu519@mykernel.net (mailing list archive) |
---|---|
State | Accepted |
Commit | 4050957c7c2c14aa795dbf423b4180d5ac04e113 |
Headers | show |
Series | fix a common error of while loop condition in error path | expand |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 964dceb28c1e..68ea92742b06 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1342,7 +1342,7 @@ static int __maybe_unused gsc_runtime_resume(struct device *dev) for (i = 0; i < ctx->num_clocks; i++) { ret = clk_prepare_enable(ctx->clocks[i]); if (ret) { - while (--i > 0) + while (--i >= 0) clk_disable_unprepare(ctx->clocks[i]); return ret; }
Fix missing resource cleanup(when '(--i) == 0') for error case in gsc_runtime_resume(). Signed-off-by: Chengguang Xu <cgxu519@mykernel.net> --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)