]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/msm/dsi: fix off by one in dsi_bus_clk_enable error handling
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 1 Oct 2021 12:34:09 +0000 (15:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:40:17 +0000 (11:40 +0200)
commit c8f01ffc83923a91e8087aaa077de13354a7aa59 upstream.

This disables a lock which wasn't enabled and it does not disable
the first lock in the array.

Fixes: fb202c2f3053 ("drm/msm/dsi: Parse bus clocks from a list")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20211001123409.GG2283@kili
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/msm/dsi/dsi_host.c

index 1e7b1be25bb07a1d6ac2b7134dded4fdac23c68a..5613234823f7d0f78f778445499f51e08049bc68 100644 (file)
@@ -460,7 +460,7 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
 
        return 0;
 err:
-       for (; i > 0; i--)
+       while (--i >= 0)
                clk_disable_unprepare(msm_host->bus_clks[i]);
 
        return ret;