Return-Path: 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 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" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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];