From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754494AbdLGOxc (ORCPT ); Thu, 7 Dec 2017 09:53:32 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:59149 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754441AbdLGOx3 (ORCPT ); Thu, 7 Dec 2017 09:53:29 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20171207145326euoutp012257ecb1b2f306a8c8b7df5255b71fc1~_Cs5uCPkO2128021280euoutp01B X-AuditID: cbfec7f2-f793b6d000003243-4e-5a2955e58aa8 MIME-version: 1.0 Content-type: text/plain; charset="utf-8"; format="flowed" Subject: Re: [PATCH] media: s5p-jpeg: Fix off-by-one problem To: Flavio Ceolin , linux-kernel@vger.kernel.org Cc: Jacek Anaszewski , Mauro Carvalho Chehab , "open list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT" , "open list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT" From: Andrzej Pietrasiewicz Message-id: <67ddf04e-2f0f-c14b-90ce-0f29a3647e16@samsung.com> Date: Thu, 07 Dec 2017 15:53:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-reply-to: <20171206163746.8456-1-flavio.ceolin@intel.com> Content-language: en-US Content-transfer-encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJKsWRmVeSWpSXmKPExsWy7djP87pPQzWjDPZOUbb4ve49m8XtrRtY LDY9vsZqcXnXHDaLng1bWS2WbfrD5MDmsXPWXXaPxXteMnlsWtXJ5rF5Sb3H501yAaxRXDYp qTmZZalF+nYJXBn33xQVbOWoWLSgiamB8StbFyMnh4SAicT/PW9YIWwxiQv31gPFuTiEBJYy Sly+fIkZwvnMKLHyyz0WmI6n1+6xQySWMUpcXLcDb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evPGeZwCg4C8mxs5AcOwtJyywkLQsYWVYxiqSW Fuem5xYb6hUn5haX5qXrJefnbmIERsK2Yz8372C8tDH4EKMAB6MSD2+Ek2aUEGtiWXFl7iFG CQ5mJRHeK3xAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4ry9e1ZHCgmkJ5akZqemFqQWwWSZODil Ghjnf9+R9DEgT291wLO3zXe/7WXunZ56VeQve3ot12MJycDXGZ/LjQW/eG2seRledPf/LTem s5vn//9z4L5sfN/nxRnSXN3zwhf1um5SMWSo//Z4usBDPmEr593nqn9cibFc+/aYwot/vxX2 9ks/zgwu/LlaNY9F6OqfbnNhh+bVi2Mm1J7S31GmxFKckWioxVxUnAgA5AqnhIACAAA= X-CMS-MailID: 20171207145325eucas1p13597cfadc2415f4df1902d5b0c5620e8 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20171206163802epcas1p3527bd6a922fd31aa80cf349a510a71eb X-RootMTR: 20171206163802epcas1p3527bd6a922fd31aa80cf349a510a71eb References: <20171206163746.8456-1-flavio.ceolin@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Andrzej Pietrasiewicz > --- > 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; > } > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mailout1.w1.samsung.com ([210.118.77.11]:59149 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754441AbdLGOx3 (ORCPT ); Thu, 7 Dec 2017 09:53:29 -0500 MIME-version: 1.0 Content-type: text/plain; charset="utf-8"; format="flowed" Subject: Re: [PATCH] media: s5p-jpeg: Fix off-by-one problem To: Flavio Ceolin , linux-kernel@vger.kernel.org Cc: Jacek Anaszewski , Mauro Carvalho Chehab , "open list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT" , "open list:ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT" From: Andrzej Pietrasiewicz Message-id: <67ddf04e-2f0f-c14b-90ce-0f29a3647e16@samsung.com> Date: Thu, 07 Dec 2017 15:53:23 +0100 In-reply-to: <20171206163746.8456-1-flavio.ceolin@intel.com> Content-language: en-US Content-transfer-encoding: 8bit References: <20171206163746.8456-1-flavio.ceolin@intel.com> Sender: linux-media-owner@vger.kernel.org List-ID: 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 Acked-by: Andrzej Pietrasiewicz > --- > 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; > } > From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrzej.p@samsung.com (Andrzej Pietrasiewicz) Date: Thu, 07 Dec 2017 15:53:23 +0100 Subject: [PATCH] media: s5p-jpeg: Fix off-by-one problem In-Reply-To: <20171206163746.8456-1-flavio.ceolin@intel.com> References: <20171206163746.8456-1-flavio.ceolin@intel.com> Message-ID: <67ddf04e-2f0f-c14b-90ce-0f29a3647e16@samsung.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 Acked-by: Andrzej Pietrasiewicz > --- > 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; > } >