summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorNizam Haider <nizamhaider786@gmail.com>2015-11-16 05:35:57 +0530
committerJonathan Cameron <jic23@kernel.org>2015-11-22 12:06:19 +0000
commit3fba9b5ff837ed57a993e98245378c30911ab4ee (patch)
tree6b4c20201ce865b0736934bb3d891cbef29868b9 /drivers/iio
parent438f13a283e776957779e9beb0503100801ea84f (diff)
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 <nijamh@cdac.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/at91_adc.c2
1 files changed, 1 insertions, 1 deletions
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;