Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a240c5b authored by Markus Elfring's avatar Markus Elfring Committed by Pawel Moll
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarPawel Moll <pawel.moll@arm.com>
parent 60aba820
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1520,9 +1520,9 @@ static int arm_ccn_probe(struct platform_device *pdev)
	if (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);
	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);
	if (!ccn->node || !ccn->xp)
		return -ENOMEM;