From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758605AbbCDOaN (ORCPT ); Wed, 4 Mar 2015 09:30:13 -0500 Received: from mx1.polytechnique.org ([129.104.30.34]:52804 "EHLO mx1.polytechnique.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757988AbbCDOaL (ORCPT ); Wed, 4 Mar 2015 09:30:11 -0500 X-Greylist: delayed 307 seconds by postgrey-1.27 at vger.kernel.org; Wed, 04 Mar 2015 09:30:11 EST From: Nicolas Iooss To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Nicolas Iooss Subject: [PATCH] ihex: restore missing default in switch statement Date: Wed, 4 Mar 2015 22:24:10 +0800 Message-Id: <1425479050-5997-1-git-send-email-nicolas.iooss_linux@m4x.org> X-Mailer: git-send-email 2.3.1 X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Wed Mar 4 15:25:01 2015 +0100 (CET)) X-Spam-Flag: No, tests=bogofilter, spamicity=0.000009, queueID=5D34F1408EEEA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 2473238eac95 ("ihex: add support for CS:IP/EIP records") removes the "default:" statement in the switch block, making the "return usage();" line dead code and ihex2fw silently ignoring unknown options. Restore this statement. This bug was found by building with HOSTCC=clang and adding -Wunreachable-code-return to HOSTCFLAGS. Fixes: 2473238eac95 ("ihex: add support for CS:IP/EIP records") Signed-off-by: Nicolas Iooss --- firmware/ihex2fw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/ihex2fw.c b/firmware/ihex2fw.c index cf38e159131a..08d90e25abf0 100644 --- a/firmware/ihex2fw.c +++ b/firmware/ihex2fw.c @@ -86,6 +86,7 @@ int main(int argc, char **argv) case 'j': include_jump = 1; break; + default: return usage(); } } -- 2.3.1