Skip to content

Commit 230efff

Browse files
emuslndavem330
authored andcommitted
ionic: fix sizeof usage
Use the actual pointer that we care about as the subject of the sizeof, rather than a struct name. Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0f4e7f4 commit 230efff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -676,20 +676,20 @@ static int ionic_qcqs_alloc(struct ionic_lif *lif)
676676

677677
err = -ENOMEM;
678678
lif->txqcqs = devm_kcalloc(dev, lif->ionic->ntxqs_per_lif,
679-
sizeof(struct ionic_qcq *), GFP_KERNEL);
679+
sizeof(*lif->txqcqs), GFP_KERNEL);
680680
if (!lif->txqcqs)
681681
goto err_out;
682682
lif->rxqcqs = devm_kcalloc(dev, lif->ionic->nrxqs_per_lif,
683-
sizeof(struct ionic_qcq *), GFP_KERNEL);
683+
sizeof(*lif->rxqcqs), GFP_KERNEL);
684684
if (!lif->rxqcqs)
685685
goto err_out;
686686

687687
lif->txqstats = devm_kcalloc(dev, lif->ionic->ntxqs_per_lif,
688-
sizeof(struct ionic_tx_stats), GFP_KERNEL);
688+
sizeof(*lif->txqstats), GFP_KERNEL);
689689
if (!lif->txqstats)
690690
goto err_out;
691691
lif->rxqstats = devm_kcalloc(dev, lif->ionic->nrxqs_per_lif,
692-
sizeof(struct ionic_rx_stats), GFP_KERNEL);
692+
sizeof(*lif->rxqstats), GFP_KERNEL);
693693
if (!lif->rxqstats)
694694
goto err_out;
695695

0 commit comments

Comments
 (0)