Skip to content

Commit f038f39

Browse files
JiangJiaskuba-moo
authored andcommitted
octeontx2-vf: Add missing free for alloc_percpu
Add the free_percpu for the allocated "vf->hw.lmt_info" in order to avoid memory leak, same as the "pf->hw.lmt_info" in `drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c`. Fixes: 5c05120 ("octeontx2-pf: cn10k: Use runtime allocated LMTLINE region") Signed-off-by: Jiasheng Jiang <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Acked-by: Geethasowjanya Akula <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f36fa55 commit f038f39

File tree

1 file changed

+2
-0
lines changed
  • drivers/net/ethernet/marvell/octeontx2/nic

1 file changed

+2
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
709709
err_ptp_destroy:
710710
otx2_ptp_destroy(vf);
711711
err_detach_rsrc:
712+
free_percpu(vf->hw.lmt_info);
712713
if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))
713714
qmem_free(vf->dev, vf->dync_lmt);
714715
otx2_detach_resources(&vf->mbox);
@@ -762,6 +763,7 @@ static void otx2vf_remove(struct pci_dev *pdev)
762763
otx2_shutdown_tc(vf);
763764
otx2vf_disable_mbox_intr(vf);
764765
otx2_detach_resources(&vf->mbox);
766+
free_percpu(vf->hw.lmt_info);
765767
if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))
766768
qmem_free(vf->dev, vf->dync_lmt);
767769
otx2vf_vfaf_mbox_destroy(vf);

0 commit comments

Comments
 (0)