[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250930061236.31359-2-bo@mboxify.com>
Date: Tue, 30 Sep 2025 14:12:35 +0800
From: Bo Sun <bo@...xify.com>
To: sgoutham@...vell.com,
gakula@...vell.com,
kuba@...nel.org,
pabeni@...hat.com
Cc: sbhatta@...vell.com,
hkelam@...vell.com,
horms@...nel.org,
bbhushan2@...vell.com,
andrew+netdev@...n.ch,
davem@...emloft.net,
edumazet@...gle.com,
sumang@...vell.com,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bo Sun <bo@...xify.com>,
stable@...r.kernel.org
Subject: [PATCH net 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")
Cc: stable@...r.kernel.org
Signed-off-by: Bo Sun <bo@...xify.com>
---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
index 7ebb6e656884..25381f079b97 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c
@@ -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);
}
--
2.50.1 (Apple Git-155)
Powered by blists - more mailing lists