Re: [PATCH net] bnxt: fix memory leak in bnxt_queue_mem_alloc error cases

From: Joe Damato

Date: Tue Jul 28 2026 - 15:31:08 EST


On Tue, Jul 28, 2026 at 12:11:45PM -0700, Will Chen wrote:
> There is a small memory leak in bnxt_queue_mem_alloc:
> when bnxt_alloc_rx_agg_bmap() succeeds
> but bnxt_alloc_one_tpa_info() later fails,
> the rx_agg_bmap allocated by bnxt_alloc_rx_agg_bmap()
> is not freed in the fallthrough cleanup cases.
>
> Simply free the rx_agg_bmap in theerr_free_tpa_info case,
> as this is the only remaining error path where
> rx_agg_bmap is allocated and needs to be freed.
>
> Fixes: bd649c5cc958 ("bnxt_en: handle tpa_info in queue API implementation")
> Signed-off-by: Will Chen <will.chen.tty@xxxxxxxxx>
> ---
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++
> 1 file changed, 2 insertions(+)
>

Reviewed-by: Joe Damato <joe@xxxxxxx>