From patchwork Sat Dec 29 22:37:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 16032 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Tp524-0004Hf-QD; Sat, 29 Dec 2012 23:37:32 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp id 1Tp524-0007NN-Ab; Sat, 29 Dec 2012 23:37:32 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753423Ab2L2Wh3 (ORCPT + 1 other); Sat, 29 Dec 2012 17:37:29 -0500 Received: from smtp207.alice.it ([82.57.200.103]:37914 "EHLO smtp207.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753323Ab2L2Wh1 (ORCPT ); Sat, 29 Dec 2012 17:37:27 -0500 Received: from jcn (87.1.17.201) by smtp207.alice.it (8.6.058.01) id 5091339C08C9C817; Sat, 29 Dec 2012 23:37:26 +0100 Received: from ao2 by jcn with local (Exim 4.80) (envelope-from ) id 1Tp51v-0006Vj-RX; Sat, 29 Dec 2012 23:37:23 +0100 From: Antonio Ospite To: linux-media@vger.kernel.org Cc: Antonio Ospite Subject: [PATCH 1/2] contrib/m920x/m920x_parse.pl: stricter check when extracting firmware Date: Sat, 29 Dec 2012 23:37:07 +0100 Message-Id: <1356820628-24992-2-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1356820628-24992-1-git-send-email-ospite@studenti.unina.it> References: <1356820628-24992-1-git-send-email-ospite@studenti.unina.it> X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.12.29.222719 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_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, BODY_SIZE_900_999 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 ' Extract firmware only from the right messages, skip the other messages. Signed-off-by: Antonio Ospite --- contrib/m920x/m920x_parse.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 contrib/m920x/m920x_parse.pl diff --git a/contrib/m920x/m920x_parse.pl b/contrib/m920x/m920x_parse.pl old mode 100644 new mode 100755 index b309250..a6ca80a --- a/contrib/m920x/m920x_parse.pl +++ b/contrib/m920x/m920x_parse.pl @@ -195,8 +195,9 @@ if ($mode eq "fw") { last; } + my $is_fw_msg = $bytes[0] eq "40" && $bytes[1] eq "30"; my $len = hex($bytes[6] . $bytes[7]); - if ($len < 32) { + if (!$is_fw_msg || $len < 32) { next; }