]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
octeontx2-vf: fix bitmap leak
authorBo Sun <bo@mboxify.com>
Tue, 30 Sep 2025 06:12:35 +0000 (14:12 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 1 Oct 2025 00:27:39 +0000 (17:27 -0700)
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: efabce290151 ("octeontx2-pf: AF_XDP zero copy receive support")
Signed-off-by: Bo Sun <bo@mboxify.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c

index 7ebb6e656884ae82e212fb8d84e23f407062e4ae..25381f079b97d6cbd183791b4998ee302a143f1b 100644 (file)
@@ -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);
 }