From patchwork Mon Oct 14 04:43:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 3034211 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 395389F3E2 for ; Mon, 14 Oct 2013 04:43:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4490C20254 for ; Mon, 14 Oct 2013 04:43:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E0BF82023F for ; Mon, 14 Oct 2013 04:43:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750749Ab3JNEnc (ORCPT ); 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 ); 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 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-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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(-) 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;