Re: [PATCH] octeontx2-af: Free BPID bitmap on setup failure

From: Simon Horman

Date: Fri Jun 26 2026 - 11:22:58 EST


On Thu, Jun 25, 2026 at 08:34:31AM +0800, haoxiang_li2024 wrote:
>
>
> At 2026-06-25 01:09:30, "Simon Horman" <horms@xxxxxxxxxx> wrote:
> >On Tue, Jun 23, 2026 at 07:43:16PM +0800, Haoxiang Li wrote:
> >> nix_setup_bpids() allocates bp->bpids with rvu_alloc_bitmap(), which uses
> >> a plain kcalloc(). If any of the following devm_kcalloc() allocations for
> >> the BPID mapping arrays fails, the function returns without freeing the
> >> bitmap. Free the BPID bitmap before returning from those error paths.
> >>
> >> Fixes: d6212d2e41a0 ("octeontx2-af: Create BPIDs free pool")
> >> Cc: stable@xxxxxxxxxxxxxxx
> >> Signed-off-by: Haoxiang Li <haoxiang_li2024@xxxxxxx>
> >
> >Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
> >
> >I am wondering if you did a pass for any other similar problems
> >with users of rvu_alloc_bitmap.
>
> Thanks for your review! Yes, I did. I found similar issues in
> nix_setup_ipolicers() and rvu_setup_msix_resources(), and
> I will address them in follow-up patches.

Likewise, thanks.