Skip to content

Commit bf2bcd6

Browse files
ISCAS-Vulabdavem330
authored andcommitted
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: Xu Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8dfddfb commit bf2bcd6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,8 @@ int otx2_config_npa(struct otx2_nic *pfvf)
12261226
if (!hw->pool_cnt)
12271227
return -EINVAL;
12281228

1229-
qset->pool = devm_kzalloc(pfvf->dev, sizeof(struct otx2_pool) *
1230-
hw->pool_cnt, GFP_KERNEL);
1229+
qset->pool = devm_kcalloc(pfvf->dev, hw->pool_cnt,
1230+
sizeof(struct otx2_pool), GFP_KERNEL);
12311231
if (!qset->pool)
12321232
return -ENOMEM;
12331233

0 commit comments

Comments
 (0)