[PATCH 1/2] of: fdt: Fix fdt size_dt_struct
Sascha Hauer
s.hauer at pengutronix.de
Fri Nov 8 09:23:42 EST 2013
size_dt_struct was calculated too big, we have to substract ofs.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/of/fdt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 5055eee..b136dad 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -409,10 +409,9 @@ void *of_flatten_dtb(struct device_node *node)
fdt.dt_nextofs = dt_next_ofs(fdt.dt_nextofs, sizeof(struct fdt_node_header));
header.size_dt_strings = cpu_to_fdt32(fdt.str_nextofs);
- header.size_dt_struct = cpu_to_fdt32(fdt.dt_nextofs);
+ header.size_dt_struct = cpu_to_fdt32(fdt.dt_nextofs - ofs);
header.off_dt_struct = cpu_to_fdt32(ofs);
-
header.off_dt_strings = cpu_to_fdt32(fdt.dt_nextofs);
if (fdt.dt_size - fdt.dt_nextofs < fdt.str_nextofs) {
--
1.8.4.rc3
More information about the barebox
mailing list