Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753054AbdICPH4 (ORCPT ); Sun, 3 Sep 2017 11:07:56 -0400 Received: from smtprelay0107.hostedemail.com ([216.40.44.107]:53144 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752894AbdICPHz (ORCPT ); Sun, 3 Sep 2017 11:07:55 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599: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:2551:2553:2559:2562:2828:2911:3138:3139:3140:3141:3142:3353:3622:3865:3866:3868:3870:3871:3873:3874:4321:4362:4425:4605:5007:6119:8700:10004:10400:10848:11026:11232:11658:11783:11914:12043:12050:12438:12679:12740:12895:13069:13160:13229:13311:13357:13439:13894:14659:14721:21067:21080:21627:30054:30070:30090: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:1,LUA_SUMMARY:none X-HE-Tag: rail79_27b716270160e X-Filterd-Recvd-Size: 2570 Message-ID: <1504451271.31325.7.camel@perches.com> Subject: Re: [PATCH 4.9 01/12] p54: memset(0) whole array From: Joe Perches To: Christian Lamparter Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jiri Slaby , Kalle Valo Date: Sun, 03 Sep 2017 08:07:51 -0700 In-Reply-To: <8363580.vTBpPrDd2o@debian64> References: <20170831154238.914795784@linuxfoundation.org> <1504197650.2786.38.camel@perches.com> <1504367461.2361.26.camel@perches.com> <8363580.vTBpPrDd2o@debian64> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 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 Content-Length: 1565 Lines: 47 On Sun, 2017-09-03 at 14:32 +0200, Christian Lamparter wrote: > On Saturday, September 2, 2017 8:51:01 AM CEST Joe Perches wrote: > > 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. [] > > > > +++ 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. > > hm? > > Please, just look again at [0]: [] > yes: "curve_data" is a pointer. Thank you. My mistake, curve_data here is an array of structs. > This means that chan->curve_data is 64 bytes in total. I saw only: drivers/net/wireless/intersil/p54/p54.h:????????struct p54_cal_database *curve_data; and did not notice drivers/net/wireless/intersil/p54/lmac.h: struct p54_pa_curve_data_sample curve_data[8];