diff mbox

[U-Boot,v2,02/14] fdt: Correct handling of alias regions

Message ID 1445132487-13172-3-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Michal Simek
Headers show

Commit Message

Simon Glass Oct. 18, 2015, 1:41 a.m. UTC
At present the last four bytes of the alias region are dropped in
the case where the last alias is included. This results in a corrupted
device tree. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 lib/libfdt/fdt_region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/lib/libfdt/fdt_region.c b/lib/libfdt/fdt_region.c
index 9fea775..747d8bb 100644
--- a/lib/libfdt/fdt_region.c
+++ b/lib/libfdt/fdt_region.c
@@ -101,7 +101,7 @@  int fdt_add_alias_regions(const void *fdt, struct fdt_region *region, int count,
 			continue;
 		next = fdt_next_property_offset(fdt, offset);
 		if (next < 0)
-			next = node_end - sizeof(fdt32_t);
+			next = node_end;
 
 		if (!did_alias_header) {
 			fdt_add_region(info, base + node, 12);