From patchwork Fri Jul 25 14:20:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 4623371 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 6E83F9F380 for ; Fri, 25 Jul 2014 14:21:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A48642020E for ; Fri, 25 Jul 2014 14:21:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0A7C201F4 for ; Fri, 25 Jul 2014 14:21:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760093AbaGYOVT (ORCPT ); Fri, 25 Jul 2014 10:21:19 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:33012 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760297AbaGYOVS (ORCPT ); Fri, 25 Jul 2014 10:21:18 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N99003NNUJGLH10@mailout3.samsung.com>; Fri, 25 Jul 2014 23:21:16 +0900 (KST) X-AuditID: cbfee61b-f79f86d00000144c-e8-53d267dccf05 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id A6.8F.05196.CD762D35; Fri, 25 Jul 2014 23:21:16 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N99004WBUIW3L00@mmp2.samsung.com>; Fri, 25 Jul 2014 23:21:16 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, j.anaszewski@samsung.com, Sylwester Nawrocki Subject: [PATCH v3 3/9] s5p-jpeg: return error immediately after get_byte fails Date: Fri, 25 Jul 2014 16:20:47 +0200 Message-id: <1406298053-30184-4-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1406298053-30184-1-git-send-email-s.nawrocki@samsung.com> References: <1406298053-30184-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMJMWRmVeSWpSXmKPExsVy+t9jQd076ZeCDT6d1LLovfqc0aJnw1ZW ixnn9zFZHH7TzurA4tG3ZRWjx+dNcgFMUVw2Kak5mWWpRfp2CVwZ0++tYi+Yw1HRucm1gfEK WxcjJ4eEgInE5JYPTBC2mMSFe+uB4lwcQgLTGSVufJ/NCOF0MElcaprMClLFJmAo0Xu0jxHE FhGQl3jSewNsErNAnsTXT8/BJgkL+EtcON/BDmKzCKhKLJn8iQXE5hVwk5i37SjQHA6gbQoS cybZgJicAu4Sh6ZZgVQIAVWsXvqWaQIj7wJGhlWMoqkFyQXFSem5RnrFibnFpXnpesn5uZsY wUHxTHoH46oGi0OMAhyMSjy8HfUXg4VYE8uKK3MPMUpwMCuJ8BrFXwoW4k1JrKxKLcqPLyrN SS0+xCjNwaIkznuw1TpQSCA9sSQ1OzW1ILUIJsvEwSnVwMiQb7MxsrZI65q0rSLn8dD8izz3 lRiTLffnTH+f17B40drKojnd9SunqK/f7S0f48ElZ8px/YF3/T8Pzs1dUwwn37qvwJIxR0ww 5/aCjemirAESUzZ9Lw0qOTBz0pP0r9UCzQrGUYuudC031mY/76Zc/KtoeuCK1YK5uYyTTmk8 9OpKCDT/p8RSnJFoqMVcVJwIAIeD/vgGAgAA 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=-6.9 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 From: Jacek Anaszewski When parsing JPEG header s5p_jpeg_parse_hdr function should return immediately in case there was an error while reading a byte. Signed-off-by: Jacek Anaszewski Signed-off-by: Sylwester Nawrocki --- drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" 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 126199e..a3f8862 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -906,14 +906,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;