From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755411AbcBHDzL (ORCPT ); Sun, 7 Feb 2016 22:55:11 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:57427 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753805AbcBHDzJ (ORCPT ); Sun, 7 Feb 2016 22:55:09 -0500 Date: Sun, 7 Feb 2016 19:55:09 -0800 From: Greg Kroah-Hartman To: Geliang Tang Cc: =?iso-8859-1?Q?Rapha=EBl?= Beamonte , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] staging: rtl8192u: r8192U_core: use kmalloc_array instead of kmalloc Message-ID: <20160208035509.GA13031@kroah.com> References: <6ada2cca5a646c6bea9a900a48109d10cdc45e85.1446991712.git.geliangtang@163.com> <9c21d2635419867a29994568c2dfda0b72cce63d.1446991712.git.geliangtang@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 08, 2015 at 10:17:54PM +0800, Geliang Tang wrote: > Use kmalloc_array instead of kmalloc to allocate memory for an array. > > Signed-off-by: Geliang Tang > --- > drivers/staging/rtl8192u/r8192U_core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c > index e06864f..07a1447 100644 > --- a/drivers/staging/rtl8192u/r8192U_core.c > +++ b/drivers/staging/rtl8192u/r8192U_core.c > @@ -1725,8 +1725,8 @@ static short rtl8192_usb_initendpoints(struct net_device *dev) > { > struct r8192_priv *priv = ieee80211_priv(dev); > > - priv->rx_urb = kmalloc(sizeof(struct urb *) * (MAX_RX_URB + 1), > - GFP_KERNEL); > + priv->rx_urb = kmalloc_array(MAX_RX_URB + 1, sizeof(struct urb *), > + GFP_KERNEL); I don't see the benefit here with this change, do you?