Message ID | 1381725810-20202-1-git-send-email-sw0312.kim@samsung.com (mailing list archive) |
---|---|
State | Accepted, 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 1VVa0G-0004Fe-PF; Mon, 14 Oct 2013 06:43:36 +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-8) with esmtp id 1VVa0E-0000VK-ky; Mon, 14 Oct 2013 06:43:36 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750750Ab3JNEnc (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Mon, 14 Oct 2013 00:43:32 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:48291 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750722Ab3JNEnb (ORCPT <rfc822;linux-media@vger.kernel.org>); Mon, 14 Oct 2013 00:43:31 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MUN0054C6F5YVA0@mailout1.samsung.com>; Mon, 14 Oct 2013 13:43:24 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.112]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 32.7B.17682.C667B525; Mon, 14 Oct 2013 13:43:24 +0900 (KST) X-AuditID: cbfee68e-b7f756d000004512-72-525b766c7a20 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 2D.93.09055.C667B525; Mon, 14 Oct 2013 13:43:24 +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 <0MUN00IHV6GA8YN0@mmp2.samsung.com>; Mon, 14 Oct 2013 13:43:24 +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 v2] s5p-jpeg: fix uninitialized use in hdr parse Date: Mon, 14 Oct 2013 13:43:30 +0900 Message-id: <1381725810-20202-1-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <525918C1.7090704@gmail.com> References: <525918C1.7090704@gmail.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDLMWRmVeSWpSXmKPExsWyRsSkQDenLDrI4MJVXYueDVtZLWac38dk cXGdvMXhN+1A3uSXbA6sHn1bVjF6fN4kF8AUxWWTkpqTWZZapG+XwJWxdcNVtoI3XBUNn5rZ Ghj/cHQxcnJICJhIrHx+mQXCFpO4cG89WxcjF4eQwFJGiZ67vYwwRXfvXGOBSExnlNg55SKU 08oksfFZAzNIFZuAjsT+Jb9ZQWwRgSKJa0/vgdnMAlIS25aCjOXgEBZwkFi9zRAkzCKgKjF1 62ewBbwCbhLrPl1mhlimILHg3ls2EJtTQFPi6YNv7CC2kICGxLaVuxlB9koIfGeTmPftISvE IAGJb5MPsYDMlxCQldh0AGqOpMTBFTdYJjAKL2BkWMUomlqQXFCclF5kpFecmFtcmpeul5yf u4kRGLKn/z3r28F484D1IcZkoHETmaVEk/OBIZ9XEm9obGZkYWpiamxkbmlGmrCSOK9ai3Wg kEB6YklqdmpqQWpRfFFpTmrxIUYmDk6pBkbX3CDPvfGp11NP9n76EP+gcNohzxkJi+8dy9d6 tlVESdrKRaJovfm9SVwMdju7cn/uO6zvIuSpHf9lkchhhisMM45NE1btPmtavPvoTG22m+lr 3kdp8V45zZt71Exm4oWrJdu4tvgEmd8+7ND/wDf7ZKh9/WS9h2c1S5Nmbiuq1bC9seZ6R50S S3FGoqEWc1FxIgAR4gTbbwIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRmVeSWpSXmKPExsVy+t9jQd2csuggg2uL1Cx6NmxltZhxfh+T xcV18haH37QDeZNfsjmwevRtWcXo8XmTXABTVAOjTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7yp mYGhrqGlhbmSQl5ibqqtkotPgK5bZg7QNiWFssScUqBQQGJxsZK+HaYJoSFuuhYwjRG6viFB cD1GBmggYQ1jxtYNV9kK3nBVNHxqZmtg/MPRxcjJISFgInH3zjUWCFtM4sK99WxdjFwcQgLT GSV2TrnIAuG0MklsfNbADFLFJqAjsX/Jb1YQW0SgSOLa03tgNrOAlMS2pSDdHBzCAg4Sq7cZ goRZBFQlpm79zAhi8wq4Saz7dJkZYpmCxIJ7b9lAbE4BTYmnD76xg9hCAhoS21buZpzAyLuA kWEVo2hqQXJBcVJ6rqFecWJucWleul5yfu4mRnBEPJPawbiyweIQowAHoxIPr4BTdJAQa2JZ cWXuIUYJDmYlEd7dLkAh3pTEyqrUovz4otKc1OJDjMlAV01klhJNzgdGa15JvKGxiZmRpZG5 oYWRsTlpwkrivAdarQOFBNITS1KzU1MLUotgtjBxcEo1MHJFH2oWlNR/d2HJtMQbQhfXr1vv xj9l14vnuq9vuqnwtTx1nR3F1+/h8JTz2k6rffWmvWodR18p7/3b7HRNiiv5cU9W+iVmthkH jabJP7va9nLizPL2561f5Gr8/tz2ss4q9xS592l1nbj256+a/64J/sl//JpRelbCtnX3ozdf UWDsusbz+7oSS3FGoqEWc1FxIgBSA7OTzAIAAA== 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.14.43315 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_1500_1599 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, __IN_REP_TO 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. 14, 2013, 4:43 a.m. UTC
For hdr parse error, it can return false without any assignments
which cause following 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
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
---
change from v1
- add build warning to commit message
---
drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Comments
Hi Seung-Woo, On 14/10/13 06:43, Seung-Woo Kim wrote: > For hdr parse error, it can return false without any assignments > which cause following 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 > > Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> > --- > change from v1 > - add build warning to commit message Thanks for amending it, the patch added to my tree for v3.13. -- Regards, 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
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;