From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754079AbcHWQZY (ORCPT ); Tue, 23 Aug 2016 12:25:24 -0400 Received: from smtprelay0170.hostedemail.com ([216.40.44.170]:47684 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754000AbcHWQZW (ORCPT ); Tue, 23 Aug 2016 12:25:22 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2895:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3874:4321:4362:5007:6119:7903:10004:10400:10848:11026:11232:11658:11914:12438:12517:12519:12555:12740:13069:13161:13229:13311:13357:13439:13894:14181:14659:14721:21080:21434:30012:30054:30062:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:9,LUA_SUMMARY:none X-HE-Tag: toe73_4a3df0fdbe849 X-Filterd-Recvd-Size: 2190 Message-ID: <1471969508.3746.112.camel@perches.com> Subject: Re: [PATCH 1/1] printk: fix parsing of "brl=" option From: Joe Perches To: Nicolas Iooss , Andrew Morton Cc: linux-kernel@vger.kernel.org Date: Tue, 23 Aug 2016 09:25:08 -0700 In-Reply-To: <20160823154735.26294-1-nicolas.iooss_linux@m4x.org> References: <20160823154735.26294-1-nicolas.iooss_linux@m4x.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-08-23 at 17:47 +0200, Nicolas Iooss wrote: > Commit bbeddf52adc1 ("printk: move braille console support into separate > braille.[ch] files") moved the parsing of braille-related options into > _braille_console_setup(), changing the type of variable str from char* > to char**. In this commit, memcmp(str, "brl,", 4) was correctly updated > to memcmp(*str, "brl,", 4) but not memcmp(str, "brl=", 4). > > Update the code to make "brl=" option work again. > > Fixes: bbeddf52adc1 ("printk: move braille console support into separate > braille.[ch] files") > Signed-off-by: Nicolas Iooss > --- >  kernel/printk/braille.c | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/printk/braille.c b/kernel/printk/braille.c > index 276762f3a460..f735ade8494c 100644 > --- a/kernel/printk/braille.c > +++ b/kernel/printk/braille.c > @@ -12,7 +12,7 @@ char *_braille_console_setup(char **str, char **brl_options) >   if (!memcmp(*str, "brl,", 4)) { >   *brl_options = ""; >   *str += 4; > - } else if (!memcmp(str, "brl=", 4)) { > + } else if (!memcmp(*str, "brl=", 4)) { >   *brl_options = *str + 4; >   *str = strchr(*brl_options, ','); >   if (!*str) Thanks. likely the first memcmp here should be strcmp and the second should be strncmp That would have caused the compiler to show the defect.