Skip to content

Commit

Permalink
otx2_common: Use devm_kcalloc() in otx2_config_npa()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xu Wang authored and David S. Miller committed Aug 17, 2020
1 parent 8dfddfb commit bf2bcd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit bf2bcd6

Please sign in to comment.