From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Agner Date: Thu, 15 Dec 2016 15:03:26 -0800 Subject: [U-Boot] [PATCH 1/2] libfdt: overlay: Fix missing symbols condition Message-ID: <20161215230327.28896-1-stefan@agner.ch> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Stefan Agner When there is no symbols section in the device tree, overlay_fixup_phandles should return FDT_ERR_NOTFOUND instead of FDT_ERR_BADOFFSET. Signed-off-by: Stefan Agner --- lib/libfdt/fdt_overlay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libfdt/fdt_overlay.c b/lib/libfdt/fdt_overlay.c index bb41404..4a9ba40 100644 --- a/lib/libfdt/fdt_overlay.c +++ b/lib/libfdt/fdt_overlay.c @@ -495,9 +495,9 @@ static int overlay_fixup_phandles(void *fdt, void *fdto) if ((fixups_off < 0 && (fixups_off != -FDT_ERR_NOTFOUND))) return fixups_off; - /* And base DTs without symbols */ + /* But if we need to fixup phandles, symbols are required */ symbols_off = fdt_path_offset(fdt, "/__symbols__"); - if ((symbols_off < 0 && (symbols_off != -FDT_ERR_NOTFOUND))) + if (symbols_off < 0) return symbols_off; fdt_for_each_property_offset(property, fdto, fixups_off) { -- 2.10.2