mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-20 17:42:27 +07:00
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>
This commit is contained in:
parent
ae0b829df7
commit
9334d5ba32
@ -2907,8 +2907,9 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
|
|||||||
if (err && err != -EOPNOTSUPP)
|
if (err && err != -EOPNOTSUPP)
|
||||||
goto close;
|
goto close;
|
||||||
|
|
||||||
priv->cls_rules = devm_kzalloc(dev, sizeof(struct dpaa2_eth_cls_rule) *
|
priv->cls_rules = devm_kcalloc(dev, dpaa2_eth_fs_count(priv),
|
||||||
dpaa2_eth_fs_count(priv), GFP_KERNEL);
|
sizeof(struct dpaa2_eth_cls_rule),
|
||||||
|
GFP_KERNEL);
|
||||||
if (!priv->cls_rules) {
|
if (!priv->cls_rules) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto close;
|
goto close;
|
||||||
|
Loading…
Reference in New Issue
Block a user