Skip to contentSkip to conversation

kexec/arch/ppc/fixup_dtb.c: Calcuate new FDT size correctly

PATCH Applied Matthew McClintock 2 participants 2 messages Sep 21, 2010 – Sep 22, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 kexec/arch/ppc/fixup_dtb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
kexec/arch/ppc/fixup_dtb.c +2 -1
index 205fd77..29e428c 100644
@@ -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,
Signature · 8 lines
1.6.0.6



_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Applied
#1 lore raw
Quoted 6 lines · Matthew McClintock

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

Thanks, applied.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec