]> git.dujemihanovic.xyz Git - linux.git/commitdiff
drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
authorFedor Pchelkin <pchelkin@ispras.ru>
Wed, 20 Dec 2023 09:53:15 +0000 (12:53 +0300)
committerInki Dae <inki.dae@samsung.com>
Mon, 22 Jan 2024 03:24:55 +0000 (12:24 +0900)
Do not forget to call clk_disable_unprepare() on the first element of
ctx->clocks array.

Found by Linux Verification Center (linuxtesting.org).

Fixes: 8b7d3ec83aba ("drm/exynos: gsc: Convert driver to IPP v2 core API")
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_gsc.c

index 34cdabc30b4f5ee62fd788923cbf335bb4af9409..5302bebbe38c9504445313639b69cd7c53c3d153 100644 (file)
@@ -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;
                }