From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753822AbbGXKw6 (ORCPT ); Fri, 24 Jul 2015 06:52:58 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:39588 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753581AbbGXKwx (ORCPT ); Fri, 24 Jul 2015 06:52:53 -0400 Date: Fri, 24 Jul 2015 13:52:45 +0300 From: Dan Carpenter To: Joshua Clayton Cc: Larry Finger , Florian Schilhabel , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Tapasweni Pathak , Vaishali Thakkar , Nitin Kuppelur , linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: Re: [PATCH 1/5] staging: rtl8712: fix buggy size calculation Message-ID: <20150724105245.GX5371@mwanda> References: <1437712717-7287-1-git-send-email-stillcompiling@gmail.com> <1437712717-7287-2-git-send-email-stillcompiling@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437712717-7287-2-git-send-email-stillcompiling@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 23, 2015 at 09:38:33PM -0700, Joshua Clayton wrote: > r8712_get_ndis_wlan_bssid_ex_sz has a "6 * sizeof(unsigned long)" > where the underlying struct has a 6 * unsigned char. > Simplify the calculation by just subtracting the variable part from > the size of the struct. > > This also gets rid of a use of typedef NDIS_802_11_RATES_EX > > Signed-off-by: Joshua Clayton Looks like you are right. Reviewed-by: Dan Carpenter regards, dan carpenter