Commit cd9ea7da authored by Bo Sun's avatar Bo Sun Committed by Jakub Kicinski
Browse files

octeontx2-vf: fix bitmap leak



The bitmap allocated with bitmap_zalloc() in otx2vf_probe() was not
released in otx2vf_remove(). Unbinding and rebinding the driver therefore
triggers a kmemleak warning:

    unreferenced object (size 8):
      backtrace:
        bitmap_zalloc
        otx2vf_probe

Call bitmap_free() in the remove path to fix the leak.

Fixes: efabce29 ("octeontx2-pf: AF_XDP zero copy receive support")
Signed-off-by: default avatarBo Sun <bo@mboxify.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2aff4420
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -854,6 +854,7 @@ static void otx2vf_remove(struct pci_dev *pdev)
		qmem_free(vf->dev, vf->dync_lmt);
	otx2vf_vfaf_mbox_destroy(vf);
	pci_free_irq_vectors(vf->pdev);
	bitmap_free(vf->af_xdp_zc_qidx);
	pci_set_drvdata(pdev, NULL);
	free_netdev(netdev);
}