octeontx2-af: CGX: replace kfree() with rvu_free_bitmap()
PATCH 1/1 octeontx2-af: CGX: replace kfree() with rvu_free_bitmap()
mac_to_index_bmap is allocated with rvu_alloc_bitmap(), so free it with rvu_free_bitmap() instead of open-coding kfree(.bmap) to keep the alloc/free API pairing consistent.
--- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/af/cgx.c +1 -1
@@ -1822,7 +1822,7 @@ static int cgx_lmac_exit(struct cgx *cgx)continue ; cgx->mac_ops->mac_pause_frm_config (cgx, lmac->lmac_id, false);cgx_configure_interrupt (cgx, lmac, lmac->lmac_id, true); -kfree (lmac->mac_to_index_bmap.bmap); +rvu_free_bitmap (&lmac->mac_to_index_bmap);rvu_free_bitmap (&lmac->rx_fc_pfvf_bmap);rvu_free_bitmap (&lmac->tx_fc_pfvf_bmap);kfree (lmac->name);
Quoted 3 lines · Bo Sun
mac_to_index_bmapis allocated withrvu_alloc_bitmap(), so free it withrvu_free_bitmap()instead of open-coding kfree(.bmap) to keep the alloc/free API pairing consistent.
Quoted 22 lines
Signed-off-by Bo Sun <[email protected]>Reviewed-by Vadim Fedorenko <[email protected]>--- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/marvell/octeontx2/af/cgx.c +1
-1@@ -1822,7 +1822,7 @@ static int cgx_lmac_exit(struct cgx *cgx)continue ; cgx->mac_ops->mac_pause_frm_config (cgx, lmac->lmac_id, false);cgx_configure_interrupt (cgx, lmac, lmac->lmac_id, true); -kfree (lmac->mac_to_index_bmap.bmap); +rvu_free_bitmap (&lmac->mac_to_index_bmap);rvu_free_bitmap (&lmac->rx_fc_pfvf_bmap);rvu_free_bitmap (&lmac->tx_fc_pfvf_bmap);kfree (lmac->name);
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Wed, 25 Feb 2026 16:23:48 +0800 you wrote:
mac_to_index_bmapis allocated withrvu_alloc_bitmap(), so free it withrvu_free_bitmap()instead of open-coding kfree(.bmap) to keep the alloc/free API pairing consistent.Signed-off-by Bo Sun <[email protected]>Reviewed-by Vadim Fedorenko <[email protected]>[...]
Here is the summary with links:
- [net-next] octeontx2-af: CGX: replace kfree() with rvu_free_bitmap()
https://git.kernel.org/netdev/net-next/c/f22b4e6fbba5
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html