[PATCH v2 1/1] bus/dpaa: fix maybe-uninitialized in bman_release_fast
David Marchand
david.marchand at redhat.com
Tue Oct 27 08:48:53 CET 2026
On Tue, 27 Oct 2026 at 07:31, Gagandeep Singh <g.singh at nxp.com> wrote:
>
> From: Stephen Hemminger <stephen at networkplumber.org>
>
> The conversion loop is bounded only by num, which is not checked
> unless RTE_LIBRTE_DPAA_HWDEBUG is set. GCC on ppc64le and riscv
> therefore warns that bm_bufs[0] may be read uninitialized when
> copying the first entry into the RCR.
>
> Convert entry 0 unconditionally, as bman_release() does.
bman_release() looks wrong if called with num == 0 without debug flag.
This should be fixed (probably better in a followup patch as it does
not directly relate to the Fixes: tag).
It seems a simple fix is to not assign i variable in the first place
and remove the check on i before the for loop. Just rely on the for
loop check condition.
> Fixes: e55e2e2d0c66 ("bus/dpaa: optimize DPAA multi-entry buffer pool operations")
> Cc: jun.yang at nxp.com
>
> Signed-off-by: Gagandeep Singh <g.singh at nxp.com>
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
This current fix lgtm though we don't have CI that ran on it because
CI tested it against main.
It should go through next-net where it can be squashed in the original commit.
--
David Marchand
More information about the dev
mailing list