[PATCH 02/23] pbl: fdt: fix fdt_fixup_mem error handling
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed Jan 14 04:04:08 PST 2026
On 11/10/25 9:34 PM, Marco Felsch wrote:
> fdt_find_or_add_memory() returns >= 0 on success, so the return must be
> checked to be < 0. Also fix the following pr_warn() which used the wrong
> variable.
>
> Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
I split out this patch in a series that I just sent.
Cheers,
Ahmad
> ---
> pbl/fdt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/pbl/fdt.c b/pbl/fdt.c
> index c9820112c6442b65d4f462c93b6847442097c5ab..ac377446caeafb1beaeb211aa8bdec8767ae21fe 100644
> --- a/pbl/fdt.c
> +++ b/pbl/fdt.c
> @@ -128,9 +128,9 @@ int fdt_fixup_mem(void *fdt, unsigned long membase[], unsigned long memsize[],
>
> snprintf(name, sizeof(name), "memory@%lx", base);
> node = fdt_find_or_add_memory(fdt, root, name);
> - if (!node) {
> + if (node < 0) {
> pr_warn("%s: Failed to get node: %s\n",
> - name, fdt_strerror(err));
> + name, fdt_strerror(node));
> continue;
> }
>
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list