提交 3fba9b5f 编写于 作者: N Nizam Haider 提交者: 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: NJonathan Cameron <jic23@kernel.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册