Skip to content

Commit 9334d5b

Browse files
ISCAS-Vulabdavem330
authored andcommitted
drivers: dpaa2: Use devm_kcalloc() in setup_dpni()
A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kcalloc". Signed-off-by: Xu Wang <vulab@iscas.ac.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ae0b829 commit 9334d5b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2907,8 +2907,9 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
29072907
if (err && err != -EOPNOTSUPP)
29082908
goto close;
29092909

2910-
priv->cls_rules = devm_kzalloc(dev, sizeof(struct dpaa2_eth_cls_rule) *
2911-
dpaa2_eth_fs_count(priv), GFP_KERNEL);
2910+
priv->cls_rules = devm_kcalloc(dev, dpaa2_eth_fs_count(priv),
2911+
sizeof(struct dpaa2_eth_cls_rule),
2912+
GFP_KERNEL);
29122913
if (!priv->cls_rules) {
29132914
err = -ENOMEM;
29142915
goto close;

0 commit comments

Comments
 (0)