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] [day] [month] [year] [list]
Date:	Sun, 22 Nov 2015 12:06:40 +0000
From:	Jonathan Cameron <jic23@...nel.org>
To:	Nizam Haider <nizamhaider786@...il.com>
Cc:	knaack.h@....de, lars@...afoo.de, pmeerw@...erw.net,
	leupold@...-elektrotechnik.de, nicolas.ferre@...el.com,
	alexandre.belloni@...e-electrons.com, octavian.purdila@...el.com,
	linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] IIO: adc: at91_adc.c Prefer kmalloc_array over kmalloc
 with multiply

On 16/11/15 00:05, Nizam Haider wrote:
> So this patch swaps that use out for kmalloc_array instead.
> 
> Signed-off-by Nizam Haider <nijamh@...c.in>
Applied to the togreg branch of iio.git - initially push out as staging
Thanks,

Jonathan
> ---
>  drivers/iio/adc/at91_adc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
> index 7b40925..f284cd6 100644
> --- a/drivers/iio/adc/at91_adc.c
> +++ b/drivers/iio/adc/at91_adc.c
> @@ -742,7 +742,7 @@ static int at91_adc_of_get_resolution(struct at91_adc_state *st,
>  		return count;
>  	}
>  
> -	resolutions = kmalloc(count * sizeof(*resolutions), GFP_KERNEL);
> +	resolutions = kmalloc_array(count, sizeof(*resolutions), GFP_KERNEL);
>  	if (!resolutions)
>  		return -ENOMEM;
>  
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists