[PATCH v4 1/1] bus/dpaa: fix unneeded conditional in bman_release
Thomas Monjalon
thomas at monjalon.net
Mon Nov 16 17:00:19 CET 2026
16/11/2026 05:06, Gagandeep Singh:
> bman_release() computed i = num - 1 before the num == 0 bounds check,
> which only exists under RTE_LIBRTE_DPAA_HWDEBUG. With that debug flag
> disabled and num == 0, i wraps to UINT32_MAX, and the subsequent
> 'if (i)' guard is then always taken regardless of num, relying on the
> for loop's own bound to do nothing. The indirection added no value and
> obscured the num == 0 handling.
>
> Drop the i = num - 1 initializer and the if (i) wrapper, relying
> solely on the for (i = 1; i < num; i++) loop condition, matching the
> simpler pattern already used in bman_release_fast().
>
> Fixes: f38f61e982f8 ("bus/dpaa: add BMAN hardware interfaces")
>
> Signed-off-by: Gagandeep Singh <g.singh at nxp.com>
Applied, thanks.
More information about the dev
mailing list