提交 0a240c5b 编写于 作者: M Markus Elfring 提交者: Pawel Moll

bus: arm-ccn: Use devm_kcalloc() in arm_ccn_probe()

Multiplications for the size determination of memory allocations
indicated that array data structures should be processed.
Thus use the corresponding function "devm_kcalloc".

This issue was detected by using the Coccinelle software.
Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: NPawel Moll <pawel.moll@arm.com>
上级 60aba820
...@@ -1520,10 +1520,10 @@ static int arm_ccn_probe(struct platform_device *pdev) ...@@ -1520,10 +1520,10 @@ static int arm_ccn_probe(struct platform_device *pdev)
if (err) if (err)
return err; return err;
ccn->node = devm_kzalloc(ccn->dev, sizeof(*ccn->node) * ccn->num_nodes, ccn->node = devm_kcalloc(ccn->dev, ccn->num_nodes, sizeof(*ccn->node),
GFP_KERNEL); GFP_KERNEL);
ccn->xp = devm_kzalloc(ccn->dev, sizeof(*ccn->node) * ccn->num_xps, ccn->xp = devm_kcalloc(ccn->dev, ccn->num_xps, sizeof(*ccn->node),
GFP_KERNEL); GFP_KERNEL);
if (!ccn->node || !ccn->xp) if (!ccn->node || !ccn->xp)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册