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

From: Michael Chan

Date: Wed Jul 29 2026 - 18:35:36 EST


On Wed, Jul 29, 2026 at 3:01 PM Will Chen <will.chen.tty@xxxxxxxxx> 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.
>
> Free the rx_agg_bmap in the err_free_rx_agg_ring case
> and initialize clone->rx_agg_bmap = NULL earlier in the function
> to allow for safe fallthrough.
>
> Fixes: bd649c5cc958 ("bnxt_en: handle tpa_info in queue API implementation")
> Signed-off-by: Will Chen <will.chen.tty@xxxxxxxxx>
> Reviewed-by: Joe Damato <joe@xxxxxxx>

Thanks.
Reviewed-by: Michael Chan <michael.chan@xxxxxxxxxxxx>

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature