[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <67ddf04e-2f0f-c14b-90ce-0f29a3647e16@samsung.com>
Date: Thu, 07 Dec 2017 15:53:23 +0100
From: Andrzej Pietrasiewicz <andrzej.p@...sung.com>
To: Flavio Ceolin <flavio.ceolin@...el.com>,
linux-kernel@...r.kernel.org
Cc: Jacek Anaszewski <jacek.anaszewski@...il.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
"open list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT"
<linux-arm-kernel@...ts.infradead.org>,
"open list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT"
<linux-media@...r.kernel.org>
Subject: Re: [PATCH] media: s5p-jpeg: Fix off-by-one problem
W dniu 06.12.2017 o 17:37, Flavio Ceolin pisze:
> s5p_jpeg_runtime_resume() does not call clk_disable_unprepare() for
> jpeg->clocks[0] when one of the clk_prepare_enable() fails.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Flavio Ceolin <flavio.ceolin@...el.com>
Acked-by: Andrzej Pietrasiewicz <andrzej.p@...sung.com>
> ---
> drivers/media/platform/s5p-jpeg/jpeg-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
> index faac816..79b63da 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;
> }
>
Powered by blists - more mailing lists