Skip to contentSkip to conversation

octeontx2: fix bitmap leaks in PF and VF

PATCH Applied Bo Sun 2 participants 4 messages Sep 30, 2025 – Oct 1, 2025

Subsystems (4)
lore
Share & tools
lore

Bo Sun

author
#0 lore raw

v2 cover octeontx2: fix bitmap leaks in PF and VF

Two small patches that free the AF_XDP bitmap in the PF and VF remove paths. Both carry the same Fixes tag and should go to stable.

Changes in v2:
- Add correct [PATCH net v2] subject prefix
- CC the sign-off authors that introduced the leak and everyone returned by scripts/get_maintainer.pl

Bo Sun (2):
octeontx2-vf: fix bitmap leak
octeontx2-pf: fix bitmap leak

 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 1 +
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 1 +
 2 files changed, 2 insertions(+)
Signature · 1 line
2.50.1 (Apple Git-155)
author
#1 lore raw

PATCH v2 1/2 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 efabce290151 ("octeontx2-pf: AF_XDP zero copy receive support")
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +1 -0
index 7ebb6e656884..25381f079b97 100644
@@ -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);
 }
Signature · 1 line
2.50.1 (Apple Git-155)
author
#2 lore raw

PATCH v2 2/2 octeontx2-pf: fix bitmap leak

In reply to Bo Sun

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")
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +1 -0
index 5027fae0aa77..e808995703cf 100644
@@ -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);
 }
Signature · 1 line
2.50.1 (Apple Git-155)
#3 lore raw
In reply to Bo Sun
This series was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Tue, 30 Sep 2025 14:12:34 +0800 you wrote:

Two small patches that free the AF_XDP bitmap in the PF and VF remove paths. Both carry the same Fixes tag and should go to stable.

Changes in v2:
- Add correct [PATCH net v2] subject prefix
- CC the sign-off authors that introduced the leak and everyone returned by scripts/get_maintainer.pl

[...]

Here is the summary with links:
- [net,v2,1/2] octeontx2-vf: fix bitmap leak

    https://git.kernel.org/netdev/net/c/cd9ea7da41a4
  - [net,v2,2/2] octeontx2-pf: fix bitmap leak
    https://git.kernel.org/netdev/net/c/92e9f4faffca

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html