]> git.sur5r.net Git - u-boot/commitdiff
fdt: Correct handling of alias regions
authorSimon Glass <sjg@chromium.org>
Sun, 18 Oct 2015 01:41:15 +0000 (19:41 -0600)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 4 Nov 2015 13:49:51 +0000 (14:49 +0100)
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>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
lib/libfdt/fdt_region.c

index 9fea775a970433af5569d1eb4da4931942b4fefe..747d8bb86aa418111b172ef549fc7d2e9a6cc79b 100644 (file)
@@ -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);