Message ID | 1381388791-1828-1-git-send-email-sw0312.kim@samsung.com (mailing list archive) |
---|---|
State | RFC, archived |
Delegated to: | Sylwester Nawrocki |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1VUAKd-0006kN-2J; Thu, 10 Oct 2013 09:06:47 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-6) with esmtp id 1VUAKa-0008Ss-6F; Thu, 10 Oct 2013 09:06:46 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752286Ab3JJHGm (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Thu, 10 Oct 2013 03:06:42 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:16198 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751125Ab3JJHGl (ORCPT <rfc822;linux-media@vger.kernel.org>); Thu, 10 Oct 2013 03:06:41 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MUF00LOXYCJXL90@mailout4.samsung.com>; Thu, 10 Oct 2013 16:06:28 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.112]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 02.EF.31253.4F156525; Thu, 10 Oct 2013 16:06:28 +0900 (KST) X-AuditID: cbfee690-b7f3b6d000007a15-0b-525651f49b44 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 94.A7.09055.3F156525; Thu, 10 Oct 2013 16:06:28 +0900 (KST) Received: from localhost.localdomain ([10.252.75.83]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MUF00IXKYEP12G2@mmp2.samsung.com>; Thu, 10 Oct 2013 16:06:27 +0900 (KST) From: Seung-Woo Kim <sw0312.kim@samsung.com> To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org, m.chehab@samsung.com, s.nawrocki@samsung.com Cc: sw0312.kim@samsung.com Subject: [PATCH] s5p-jpeg: fix uninitialized use in hdr parse Date: Thu, 10 Oct 2013 16:06:31 +0900 Message-id: <1381388791-1828-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsWyRsSkQPdLYFiQwdxrHBY9G7ayWsw4v4/J 4uI6eYvDb9qBvMkv2RxYPfq2rGL0+LxJLoApissmJTUnsyy1SN8ugStj2QGhghb2ihPzmpgb GE+zdjFyckgImEjcuLoIyhaTuHBvPVsXIxeHkMBSRomt/bsYuxg5wIo+zfaAiE9nlFjf2QXW ICTQyiSxdokqiM0moCOxf8lvsLiIQJHEtaf3wGxmASmJbUtBhnJyCAvYShw6PAPMZhFQlfh3 fjEziM0r4Cpx+9l6JogjFCQW3HsLdoSEwG02ib5711ghGgQkvk0+xAJxkKzEpgPMEPWSEgdX 3GCZwCi4gJFhFaNoakFyQXFSepGJXnFibnFpXrpecn7uJkZg+J3+92zCDsZ7B6wPMSYDjZvI LCWanA8M37ySeENjMyMLUxNTYyNzSzPShJXEedVbrAOFBNITS1KzU1MLUovii0pzUosPMTJx cEo1MDZN0PpyxeFUkteir/7KJ5KUFsZNEt+yyXa7oRyXkYQ2T/6S5Se+HT5xSmDhxfiLO7TZ ZdlfJqWJirGsi1nvwiCQLC3YE7Bsqb7jmvUiuvxxOeviV+1xSNDe/uHSkmfv/LR6D6U//bNr uv7HKvnXz2arXjt//nhkR49Zje+SpGLdaBfxdXZJs5VYijMSDbWYi4oTAXV8ML9VAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPIsWRmVeSWpSXmKPExsVy+t9jQd0vgWFBBpPWMlr0bNjKajHj/D4m i4vr5C0Ov2kH8ia/ZHNg9ejbsorR4/MmuQCmqAZGm4zUxJTUIoXUvOT8lMy8dFsl7+B453hT MwNDXUNLC3MlhbzE3FRbJRefAF23zBygbUoKZYk5pUChgMTiYiV9O0wTQkPcdC1gGiN0fUOC 4HqMDNBAwhrGjGUHhApa2CtOzGtibmA8zdrFyMEhIWAi8Wm2RxcjJ5ApJnHh3nq2LkYuDiGB 6YwS6zu7WEESQgKtTBJrl6iC2GwCOhL7l/wGi4sIFElce3oPzGYWkJLYthSkmZNDWMBW4tDh GWA2i4CqxL/zi5lBbF4BV4nbz9YzQSxTkFhw7y3bBEbuBYwMqxhFUwuSC4qT0nMN9YoTc4tL 89L1kvNzNzGCg/uZ1A7GlQ0WhxgFOBiVeHgrykKDhFgTy4orcw8xSnAwK4nwTj8JFOJNSays Si3Kjy8qzUktPsSYDLR9IrOUaHI+MPLySuINjU3MjCyNzA0tjIzNSRNWEuc90GodKCSQnliS mp2aWpBaBLOFiYNTqoHRYn8S7+oLqy6yVEa+z3x0+8od/sxb4X1tum8fti5UDBcImT83osfv YbvSjWtnvTpq1nNffeE3f8K/zw2F63UDNI9OeJBnUlM69ed009ANc7aUX6jef+dz99GQ3B32 HgHHNzfHrRfdsmPN/rPZurMLZnB9OP3UueO3g2PjvP6pt1/J9y5S5+Kaq8RSnJFoqMVcVJwI AD4Dw6GyAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2013.10.10.65415 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_1099 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' |
Commit Message
Seung-Woo Kim
Oct. 10, 2013, 7:06 a.m. UTC
For hdr parse error, it can return false without any assignments
which cause build warning.
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
---
drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Comments
Hi Seung-Woo, On 10/10/2013 09:06 AM, Seung-Woo Kim wrote: > For hdr parse error, it can return false without any assignments > which cause build warning. > > Signed-off-by: Seung-Woo Kim<sw0312.kim@samsung.com> > --- > drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c > index 15d2396..7db374e 100644 > --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c > +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c > @@ -442,14 +442,14 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result, > while (notfound) { > c = get_byte(&jpeg_buffer); > if (c == -1) > - break; > + return false; notfound is being assigned before entering the while loop, so I'm not sure what exactly is not correct here. Can you quote the original build warning ? It's a good idea to always include compiler errors/warnings in the commit message. BTW, name of the variable is a bit confusing, I think naming it 'found' and using negation of it would be easier to follow; that's not something we'd be changing now though. > if (c != 0xff) > continue; > do > c = get_byte(&jpeg_buffer); > while (c == 0xff); > if (c == -1) > - break; > + return false; > if (c == 0) > continue; > length = 0; Thanks, Sylwester -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Sylwester, Thanks for you comment. On 2013? 10? 12? 18:39, Sylwester Nawrocki wrote: > Hi Seung-Woo, > > On 10/10/2013 09:06 AM, Seung-Woo Kim wrote: >> For hdr parse error, it can return false without any assignments >> which cause build warning. >> >> Signed-off-by: Seung-Woo Kim<sw0312.kim@samsung.com> >> --- >> drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 ++-- >> 1 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c >> b/drivers/media/platform/s5p-jpeg/jpeg-core.c >> index 15d2396..7db374e 100644 >> --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c >> +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c >> @@ -442,14 +442,14 @@ static bool s5p_jpeg_parse_hdr(struct >> s5p_jpeg_q_data *result, >> while (notfound) { >> c = get_byte(&jpeg_buffer); >> if (c == -1) >> - break; >> + return false; > > notfound is being assigned before entering the while loop, so I'm not sure > what exactly is not correct here. Can you quote the original build > warning ? Here is the build warning. drivers/media/platform/s5p-jpeg/jpeg-core.c: In function 's5p_jpeg_parse_hdr': drivers/media/platform/s5p-jpeg/jpeg-core.c:432: warning: 'components' may be used uninitialized in this function drivers/media/platform/s5p-jpeg/jpeg-core.c:433: warning: 'height' may be used uninitialized in this function drivers/media/platform/s5p-jpeg/jpeg-core.c:433: warning: 'width' may be used uninitialized in this function > It's a good idea to always include compiler errors/warnings in the commit > message. Right, I'll repost with warning message. > > BTW, name of the variable is a bit confusing, I think naming it 'found' and > using negation of it would be easier to follow; that's not something we'd > be changing now though. > >> if (c != 0xff) >> continue; >> do >> c = get_byte(&jpeg_buffer); >> while (c == 0xff); >> if (c == -1) >> - break; >> + return false; >> if (c == 0) >> continue; >> length = 0; > > Thanks, > Sylwester >
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 15d2396..7db374e 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -442,14 +442,14 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result, while (notfound) { c = get_byte(&jpeg_buffer); if (c == -1) - break; + return false; if (c != 0xff) continue; do c = get_byte(&jpeg_buffer); while (c == 0xff); if (c == -1) - break; + return false; if (c == 0) continue; length = 0;