Skip to content

Commit 973d850

Browse files
JiangJiassmb49
authored andcommitted
octeontx2-vf: Add missing free for alloc_percpu
BugLink: https://bugs.launchpad.net/bugs/2023230 [ Upstream commit f038f39 ] 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]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Luke Nowakowski-Krijger <[email protected]>
1 parent 3973e3e commit 973d850

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,7 @@ static int otx2vf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
704704
err_unreg_netdev:
705705
unregister_netdev(netdev);
706706
err_detach_rsrc:
707+
free_percpu(vf->hw.lmt_info);
707708
if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))
708709
qmem_free(vf->dev, vf->dync_lmt);
709710
otx2_detach_resources(&vf->mbox);
@@ -738,6 +739,7 @@ static void otx2vf_remove(struct pci_dev *pdev)
738739
destroy_workqueue(vf->otx2_wq);
739740
otx2vf_disable_mbox_intr(vf);
740741
otx2_detach_resources(&vf->mbox);
742+
free_percpu(vf->hw.lmt_info);
741743
if (test_bit(CN10K_LMTST, &vf->hw.cap_flag))
742744
qmem_free(vf->dev, vf->dync_lmt);
743745
otx2vf_vfaf_mbox_destroy(vf);

0 commit comments

Comments
 (0)