octeontx2: fix bitmap leaks in PF and VF
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)
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.
--- 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
@@ -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)
PATCH v2 2/2 octeontx2-pf: fix bitmap leak
In reply to Bo SunThe 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.
--- 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
@@ -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)
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_XDPbitmap 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 byscripts/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