提交 6f2aed6a 编写于 作者: F Fabian Frederick 提交者: David S. Miller

net: dsa: replace count*size kzalloc by kcalloc

kcalloc manages count*sizeof overflow.
Signed-off-by: NFabian Frederick <fabf@skynet.be>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5bc4b46a
......@@ -607,8 +607,8 @@ static int dsa_of_probe(struct platform_device *pdev)
if (pd->nr_chips > DSA_MAX_SWITCHES)
pd->nr_chips = DSA_MAX_SWITCHES;
pd->chip = kzalloc(pd->nr_chips * sizeof(struct dsa_chip_data),
GFP_KERNEL);
pd->chip = kcalloc(pd->nr_chips, sizeof(struct dsa_chip_data),
GFP_KERNEL);
if (!pd->chip) {
ret = -ENOMEM;
goto out_free;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册