* [PATCH] media: s5p-jpeg: Fix off-by-one problem @ 2017-12-06 16:37 ` Flavio Ceolin 2017-12-07 14:53 ` Andrzej Pietrasiewicz 0 siblings, 1 reply; 2+ messages in thread From: Flavio Ceolin @ 2017-12-06 16:37 UTC (permalink / raw) To: linux-kernel Cc: Flavio Ceolin, Andrzej Pietrasiewicz, Jacek Anaszewski, Mauro Carvalho Chehab, open list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT, open list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT 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@intel.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; } -- 2.9.5 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: s5p-jpeg: Fix off-by-one problem 2017-12-06 16:37 ` [PATCH] media: s5p-jpeg: Fix off-by-one problem Flavio Ceolin @ 2017-12-07 14:53 ` Andrzej Pietrasiewicz 0 siblings, 0 replies; 2+ messages in thread From: Andrzej Pietrasiewicz @ 2017-12-07 14:53 UTC (permalink / raw) To: Flavio Ceolin, linux-kernel Cc: Jacek Anaszewski, Mauro Carvalho Chehab, open list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT, open list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT 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@intel.com> Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.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; > } > ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-07 14:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20171206163802epcas1p3527bd6a922fd31aa80cf349a510a71eb@epcas1p3.samsung.com>
2017-12-06 16:37 ` [PATCH] media: s5p-jpeg: Fix off-by-one problem Flavio Ceolin
2017-12-07 14:53 ` Andrzej Pietrasiewicz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox