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:
parent
7399925b38
commit
c9a86c5c02
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue