]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
octeontx2-pf: fix bitmap leak
authorBo Sun <bo@mboxify.com>
Tue, 30 Sep 2025 06:12:36 +0000 (14:12 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 1 Oct 2025 00:27:44 +0000 (17:27 -0700)
The bitmap allocated with bitmap_zalloc() in otx2_probe() was not
released in otx2_remove(). Unbinding and rebinding the driver therefore
triggers a kmemleak warning:

    unreferenced object (size 8):
      backtrace:
        bitmap_zalloc
        otx2_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_pf.c

index 5027fae0aa77a68d70a89f5554762fd47fb3cab2..e808995703cfd0714a133e61bdda3e9c512d5560 100644 (file)
@@ -3542,6 +3542,7 @@ static void otx2_remove(struct pci_dev *pdev)
        otx2_disable_mbox_intr(pf);
        otx2_pfaf_mbox_destroy(pf);
        pci_free_irq_vectors(pf->pdev);
+       bitmap_free(pf->af_xdp_zc_qidx);
        pci_set_drvdata(pdev, NULL);
        free_netdev(netdev);
 }