mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2 1/5] pbl: fdt: fix fdt_fixup_mem error handling
@ 2026-01-14 12:00 Ahmad Fatoum
  2026-01-14 12:00 ` [PATCH v2 2/5] pbl: compressed-dtb: add missing includes Ahmad Fatoum
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ahmad Fatoum @ 2026-01-14 12:00 UTC (permalink / raw)
  To: barebox; +Cc: Marco Felsch, Michael Tretter, Ahmad Fatoum

From: Marco Felsch <m.felsch@pengutronix.de>

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@pengutronix.de>
Fixes: ae175d4748b1 ("PBL: fdt: add fdt_fixup_mem to fixup memory nodes")
Cc: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
v1 - > v2:
  - split off preparatory patch from
    https://lore.barebox.org/barebox/20251110-v2025-09-0-topic-optee-of-handling-v1-0-8f0625ac5471@pengutronix.de/T/#t
  - Add Fixes:
---
 pbl/fdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pbl/fdt.c b/pbl/fdt.c
index c9820112c644..ac377446caea 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;
 		}
 
-- 
2.47.3




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-14 12:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-14 12:00 [PATCH v2 1/5] pbl: fdt: fix fdt_fixup_mem error handling Ahmad Fatoum
2026-01-14 12:00 ` [PATCH v2 2/5] pbl: compressed-dtb: add missing includes Ahmad Fatoum
2026-01-14 12:00 ` [PATCH v2 3/5] ARM: atf: add missing includes in atf_common.h Ahmad Fatoum
2026-01-14 12:00 ` [PATCH v2 4/5] ARM: i.MX8M: cosmetic cleanup Ahmad Fatoum
2026-01-14 12:00 ` [PATCH v2 5/5] pbl: string: add strncmp Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox