]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 07:54:35 +0000 (08:54 +0100)
[ Upstream commit 4050957c7c2c14aa795dbf423b4180d5ac04e113 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/exynos/exynos_drm_gsc.c

index 166a802628963226b6678d5668660a0761c3e29d..8c090354fd8a5c90ef45773670e5fdf8e436ce9a 100644 (file)
@@ -1346,7 +1346,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;
                }