Skip to content

Commit e716420

Browse files
ISCAS-Vulabdavem330
authored andcommitted
ionic_lif: Use devm_kcalloc() in ionic_qcq_alloc()
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]> Acked-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 26896f0 commit e716420

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/pensando/ionic/ionic_lif.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type,
412412

413413
new->flags = flags;
414414

415-
new->q.info = devm_kzalloc(dev, sizeof(*new->q.info) * num_descs,
415+
new->q.info = devm_kcalloc(dev, num_descs, sizeof(*new->q.info),
416416
GFP_KERNEL);
417417
if (!new->q.info) {
418418
netdev_err(lif->netdev, "Cannot allocate queue info\n");
@@ -462,7 +462,7 @@ static int ionic_qcq_alloc(struct ionic_lif *lif, unsigned int type,
462462
new->intr.index = IONIC_INTR_INDEX_NOT_ASSIGNED;
463463
}
464464

465-
new->cq.info = devm_kzalloc(dev, sizeof(*new->cq.info) * num_descs,
465+
new->cq.info = devm_kcalloc(dev, num_descs, sizeof(*new->cq.info),
466466
GFP_KERNEL);
467467
if (!new->cq.info) {
468468
netdev_err(lif->netdev, "Cannot allocate completion queue info\n");

0 commit comments

Comments
 (0)