qcdt: include padding in the table length fields

This commit is contained in:
Alessandro Astone 2019-10-07 23:44:03 +02:00 committed by John Wu
parent f87ee3fcf9
commit b45d922463

View File

@ -261,8 +261,9 @@ static int dtb_patch(const qcdt_hdr *hdr, const char *in, const char *out) {
val.second.offset = lseek(fd, 0, SEEK_CUR);
auto fdt = val.second.fdt;
fdt_pack(fdt);
val.second.len = fdt_totalsize(fdt);
xwrite(fd, fdt, val.second.len);
int size = fdt_totalsize(fdt);
xwrite(fd, fdt, size);
val.second.len = do_align(size, page_size);
free(fdt);
}