Skip to content

Commit 3def995

Browse files
Bo Sunkuba-moo
authored andcommitted
octeontx2-af: CGX: fix bitmap leaks
The RX/TX flow-control bitmaps (rx_fc_pfvf_bmap and tx_fc_pfvf_bmap) are allocated by cgx_lmac_init() but never freed in cgx_lmac_exit(). Unbinding and rebinding the driver therefore triggers kmemleak: unreferenced object (size 16): backtrace: rvu_alloc_bitmap cgx_probe Free both bitmaps during teardown. Fixes: e740003 ("octeontx2-af: Flow control resource management") Cc: stable@vger.kernel.org Signed-off-by: Bo Sun <bo@mboxify.com> Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev> Reviewed-by: Jijie Shao <shaojijie@huawei.com> Link: https://patch.msgid.link/20260206130925.1087588-2-bo@mboxify.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 3a23b80 commit 3def995

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • drivers/net/ethernet/marvell/octeontx2/af

drivers/net/ethernet/marvell/octeontx2/af/cgx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,6 +1823,8 @@ static int cgx_lmac_exit(struct cgx *cgx)
18231823
cgx->mac_ops->mac_pause_frm_config(cgx, lmac->lmac_id, false);
18241824
cgx_configure_interrupt(cgx, lmac, lmac->lmac_id, true);
18251825
kfree(lmac->mac_to_index_bmap.bmap);
1826+
rvu_free_bitmap(&lmac->rx_fc_pfvf_bmap);
1827+
rvu_free_bitmap(&lmac->tx_fc_pfvf_bmap);
18261828
kfree(lmac->name);
18271829
kfree(lmac);
18281830
}

0 commit comments

Comments
 (0)