From: Nizam Haider Date: Mon, 16 Nov 2015 00:05:57 +0000 (+0530) Subject: IIO: adc: at91_adc.c Prefer kmalloc_array over kmalloc with multiply X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3fba9b5ff837ed57a993e98245378c30911ab4ee;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git IIO: adc: at91_adc.c Prefer kmalloc_array over kmalloc with multiply So this patch swaps that use out for kmalloc_array instead. Signed-off-by Nizam Haider Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 7b40925dd4ff..f284cd6a93d6 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;