Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752806AbdIBPvH (ORCPT ); Sat, 2 Sep 2017 11:51:07 -0400 Received: from smtprelay0002.hostedemail.com ([216.40.44.2]:45862 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752684AbdIBPvF (ORCPT ); Sat, 2 Sep 2017 11:51:05 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:69: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:2911:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3874:4321:4425:4605:5007:6119:7576:7903:8603:10004:10400:10848:11026:11232:11657:11658:11914:12043:12438:12555:12740:12760:12895:12986:13069:13311:13357:13439:14096:14097:14181:14659:14721:21080:21433:21451:21627:30034:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: bulb67_4366db5b1a95a X-Filterd-Recvd-Size: 2879 Message-ID: <1504367461.2361.26.camel@perches.com> Subject: Re: [PATCH 4.9 01/12] p54: memset(0) whole array From: Joe Perches To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org, Jiri Slaby , Christian Lamparter , Kalle Valo Date: Sat, 02 Sep 2017 08:51:01 -0700 In-Reply-To: <1504197650.2786.38.camel@perches.com> References: <20170831154238.914795784@linuxfoundation.org> <20170831154238.982008528@linuxfoundation.org> <1504197650.2786.38.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1884 Lines: 50 On Thu, 2017-08-31 at 09:40 -0700, Joe Perches wrote: > On Thu, 2017-08-31 at 17:44 +0200, Greg Kroah-Hartman wrote: > > 4.9-stable review patch. If anyone has any objections, please let me know. > > > > ------------------ > > > > From: Jiri Slaby > > > > commit 6f17581788206444cbbcdbc107498f85e9765e3d upstream. > > > > gcc 7 complains: > > drivers/net/wireless/intersil/p54/fwio.c: In function 'p54_scan': > > drivers/net/wireless/intersil/p54/fwio.c:491:4: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size] > > > > Fix that by passing the correct size to memset. > > > > Signed-off-by: Jiri Slaby > > Cc: Christian Lamparter > > Cc: Kalle Valo > > Acked-by: Christian Lamparter > > Signed-off-by: Kalle Valo > > Signed-off-by: Greg Kroah-Hartman > > > > --- > > drivers/net/wireless/intersil/p54/fwio.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > --- a/drivers/net/wireless/intersil/p54/fwio.c > > +++ b/drivers/net/wireless/intersil/p54/fwio.c > > @@ -488,7 +488,7 @@ int p54_scan(struct p54_common *priv, u1 > > > > entry += sizeof(__le16); > > chan->pa_points_per_curve = 8; > > - memset(chan->curve_data, 0, sizeof(*chan->curve_data)); > > + memset(chan->curve_data, 0, sizeof(chan->curve_data)); > > memcpy(chan->curve_data, entry, > > sizeof(struct p54_pa_curve_data_sample) * > > min((u8)8, curve_data->points_per_channel)); > > > > Why is this change correct? > > curve_data is a pointer. > > This now clears the sizeof a pointer and not > the sizeof struct p54_cal_database So what happens here? This change seems clearly incorrect. For all stable versions.