9
0
Fork 0

of: fdt: Fix fdt size_dt_struct

size_dt_struct was calculated too big, we have to substract ofs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-11-05 16:44:21 +01:00
parent 7399925b38
commit c9a86c5c02
1 changed files with 1 additions and 2 deletions

View File

@ -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) {