From: Dan Carpenter Date: Fri, 1 Oct 2021 12:34:09 +0000 (+0300) Subject: drm/msm/dsi: fix off by one in dsi_bus_clk_enable error handling X-Git-Tag: accepted/tizen/unified/20230118.172025~6143^2~2^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8f01ffc83923a91e8087aaa077de13354a7aa59;p=platform%2Fkernel%2Flinux-rpi.git drm/msm/dsi: fix off by one in dsi_bus_clk_enable error handling This disables a lock which wasn't enabled and it does not disable the first lock in the array. Fixes: 6e0eb52eba9e ("drm/msm/dsi: Parse bus clocks from a list") Signed-off-by: Dan Carpenter Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211001123409.GG2283@kili Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark --- diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index e269df2..c86b509 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -451,7 +451,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;