提交 5bc4b46a 编写于 作者: F Fabian Frederick 提交者: David S. Miller

net: dsa: replace count*size kmalloc by kmalloc_array

kmalloc_array manages count*sizeof overflow.
Signed-off-by: NFabian Frederick <fabf@skynet.be>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f35423c1
......@@ -526,7 +526,8 @@ static int dsa_of_setup_routing_table(struct dsa_platform_data *pd,
/* First time routing table allocation */
if (!cd->rtable) {
cd->rtable = kmalloc(pd->nr_chips * sizeof(s8), GFP_KERNEL);
cd->rtable = kmalloc_array(pd->nr_chips, sizeof(s8),
GFP_KERNEL);
if (!cd->rtable)
return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册