diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index faac8161b68341194cee140dfaab5ef6c4e8cc03..79b63da27f53711e8a13024630859c35e9e097ec 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -3086,7 +3086,7 @@ static int s5p_jpeg_runtime_resume(struct device *dev) for (i = 0; i < jpeg->variant->num_clocks; i++) { ret = clk_prepare_enable(jpeg->clocks[i]); if (ret) { - while (--i > 0) + while (--i >= 0) clk_disable_unprepare(jpeg->clocks[i]); return ret; }