提交 9334d5ba 编写于 作者: X Xu Wang 提交者: David S. Miller

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: NXu Wang <vulab@iscas.ac.cn>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ae0b829d
......@@ -2907,8 +2907,9 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
if (err && err != -EOPNOTSUPP)
goto close;
priv->cls_rules = devm_kzalloc(dev, sizeof(struct dpaa2_eth_cls_rule) *
dpaa2_eth_fs_count(priv), GFP_KERNEL);
priv->cls_rules = devm_kcalloc(dev, dpaa2_eth_fs_count(priv),
sizeof(struct dpaa2_eth_cls_rule),
GFP_KERNEL);
if (!priv->cls_rules) {
err = -ENOMEM;
goto close;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册