mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 08:33:17 +02:00
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: e740003874 ("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>
This commit is contained in:
parent
3a23b80dd7
commit
3def995c4e
|
|
@ -1823,6 +1823,8 @@ static int cgx_lmac_exit(struct cgx *cgx)
|
|||
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->rx_fc_pfvf_bmap);
|
||||
rvu_free_bitmap(&lmac->tx_fc_pfvf_bmap);
|
||||
kfree(lmac->name);
|
||||
kfree(lmac);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user