Skip to contentSkip to conversation

octeontx2-af: CGX: replace kfree() with rvu_free_bitmap()

PATCH Applied Bo Sun 3 participants 3 messages Feb 25 – Feb 27

Subsystems (3)
lore
Share & tools
lore

Bo Sun

author
#0 lore raw

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
index 6000795823a3..4f33a816bc7a 100644
@@ -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);
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Bo Sun

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.

Quoted 22 lines
---
  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
index 6000795823a3..4f33a816bc7a 100644
@@ -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);
#2 lore raw
In reply to Bo Sun
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_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.

[...]

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