Commit 3fba9b5f authored by Nizam Haider's avatar Nizam Haider Committed by Jonathan Cameron

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: default avatarJonathan Cameron <jic23@kernel.org>
parent 438f13a2
...@@ -742,7 +742,7 @@ static int at91_adc_of_get_resolution(struct at91_adc_state *st, ...@@ -742,7 +742,7 @@ static int at91_adc_of_get_resolution(struct at91_adc_state *st,
return count; return count;
} }
resolutions = kmalloc(count * sizeof(*resolutions), GFP_KERNEL); resolutions = kmalloc_array(count, sizeof(*resolutions), GFP_KERNEL);
if (!resolutions) if (!resolutions)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment