lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151002173052.GP5552@saruman.tx.rr.com>
Date:	Fri, 2 Oct 2015 12:30:52 -0500
From:	Felipe Balbi <balbi@...com>
To:	Peter Senna Tschudin <peter.senna@...il.com>
CC:	<balbi@...com>, <stern@...land.harvard.edu>,
	<sergei.shtylyov@...entembedded.com>, <standby24x7@...il.com>,
	<pmladek@...e.cz>, <linux-usb@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 05/14] RFC: usb/host/fotg210: change kmalloc by
 kmalloc_array

On Mon, Sep 21, 2015 at 05:01:09PM +0200, Peter Senna Tschudin wrote:
> This patch change:
> 
> kmalloc(DBG_SCHED_LIMIT * sizeof(*seen), GFP_ATOMIC)
> 
> by:
> 
> kmalloc_array(DBG_SCHED_LIMIT, sizeof(*seen), GFP_ATOMIC)
> 
> as kmalloc_array() should be used for allocating arrays.
> 
> Signed-off-by: Peter Senna Tschudin <peter.senna@...il.com>

looks good to me

> ---
>  drivers/usb/host/fotg210-hcd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c
> index 51feb61..e7e9991 100644
> --- a/drivers/usb/host/fotg210-hcd.c
> +++ b/drivers/usb/host/fotg210-hcd.c
> @@ -501,7 +501,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
>  	unsigned i;
>  	__hc32 tag;
>  
> -	seen = kmalloc(DBG_SCHED_LIMIT * sizeof(*seen), GFP_ATOMIC);
> +	seen = kmalloc_array(DBG_SCHED_LIMIT, sizeof(*seen), GFP_ATOMIC);
>  	if (!seen)
>  		return 0;
>  
> -- 
> 2.1.0
> 

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ