mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 15:04:27 +08:00
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>
This commit is contained in:
parent
438f13a283
commit
3fba9b5ff8
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user