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

otx2_common: Use devm_kcalloc() in otx2_config_npa()

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>
上级 8dfddfb7
......@@ -1226,8 +1226,8 @@ int otx2_config_npa(struct otx2_nic *pfvf)
if (!hw->pool_cnt)
return -EINVAL;
qset->pool = devm_kzalloc(pfvf->dev, sizeof(struct otx2_pool) *
hw->pool_cnt, GFP_KERNEL);
qset->pool = devm_kcalloc(pfvf->dev, hw->pool_cnt,
sizeof(struct otx2_pool), GFP_KERNEL);
if (!qset->pool)
return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册