diff options
author | Matthew McClintock <msm@freescale.com> | 2010-09-21 17:58:51 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2010-09-22 09:17:43 +0900 |
commit | c88bd2e43b4b304f840baf1d7d40153ca6982401 (patch) | |
tree | 8ca4c6ed8b63bce91c740553cf586ca829c12fb0 | |
parent | 9e58e01336a3f387c704b9c3c3b0e213013c20c9 (diff) |
kexec/arch/ppc/fixup_dtb.c: Calcuate new FDT size correctly
It was possible to not add enough space when we allocate
more space for more memory reserve regions, this was because
we were incorrectly accounting for the size of a reserve
region. This corrects the assumed size for a resize region
Signed-off-by: Matthew McClintock <msm@freescale.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | kexec/arch/ppc/fixup_dtb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kexec/arch/ppc/fixup_dtb.c b/kexec/arch/ppc/fixup_dtb.c index 205fd77..29e428c 100644 --- a/kexec/arch/ppc/fixup_dtb.c +++ b/kexec/arch/ppc/fixup_dtb.c @@ -354,7 +354,8 @@ char *fixup_dtb_init(struct kexec_info *info, char *blob_buf, off_t *blob_size, printf("%s: Unable to pack flat device tree\n", fdt_strerror(ret)); /* info->nr_segments just a guide, will grow by at least EXPAND_GRANULARITY */ - blob_buf = expand_buf(info->nr_segments, blob_buf, blob_size); + blob_buf = expand_buf(info->nr_segments * sizeof(struct fdt_reserve_entry), + blob_buf, blob_size); /* add reserve region for *THIS* fdt */ *dtb_addr = locate_hole(info, *blob_size, 0, |