diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-04-19 09:12:43 +0200 |
---|---|---|
committer | Pawel Moll <pawel.moll@arm.com> | 2017-06-23 15:46:36 +0100 |
commit | 0a240c5b420194c24882748f1ea35f37643b032e (patch) | |
tree | e593f5fa864dbe0dc39dfe005ce40430e688f7ee /drivers/bus/arm-ccn.c | |
parent | 60aba820dec333eaa7a320de1403b77e444a178c (diff) |
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: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Diffstat (limited to 'drivers/bus/arm-ccn.c')
-rw-r--r-- | drivers/bus/arm-ccn.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c index 80758f6fdaa5..5aaa645ba726 100644 --- a/drivers/bus/arm-ccn.c +++ b/drivers/bus/arm-ccn.c @@ -1520,10 +1520,10 @@ 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, - GFP_KERNEL); - ccn->xp = devm_kzalloc(ccn->dev, sizeof(*ccn->node) * ccn->num_xps, - GFP_KERNEL); + ccn->node = devm_kcalloc(ccn->dev, ccn->num_nodes, sizeof(*ccn->node), + GFP_KERNEL); + ccn->xp = devm_kcalloc(ccn->dev, ccn->num_xps, sizeof(*ccn->node), + GFP_KERNEL); if (!ccn->node || !ccn->xp) return -ENOMEM; |