From 7300a4d1676f0c929f6a41810f9bc43d4e5334eb Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Tue, 30 Jul 2024 16:49:22 +0100 Subject: [PATCH] fix(allwinner): dtb: check for correct error condition In sunxi_soc_fdt_fixup(), we check for the value of "ret" again, after calling fdt_node_offset_by_phandle(), even though the error value of that lands in "node". Check for "node" being non-negative instead, to properly detect any errors here. Signed-off-by: Andre Przywara Change-Id: I57c1406388dbe11d343038da173019519e18af3e --- plat/allwinner/sun50i_h616/sunxi_h616_dtb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plat/allwinner/sun50i_h616/sunxi_h616_dtb.c b/plat/allwinner/sun50i_h616/sunxi_h616_dtb.c index ec49f4c9c..58bad539b 100644 --- a/plat/allwinner/sun50i_h616/sunxi_h616_dtb.c +++ b/plat/allwinner/sun50i_h616/sunxi_h616_dtb.c @@ -52,7 +52,7 @@ void sunxi_soc_fdt_fixup(void *dtb) } node = fdt_node_offset_by_phandle(dtb, phandle); - if (ret != 0) { + if (node < 0) { return; }