platform: msm_shared: Increase the buffer size for new nodes and properties
If there is a longer kernel cmdline and the total size of the data
that needs to be updated exceeds the DTB_PAD_SIZE, the pre-allocated
padding size is not enough and it will get an error when trying to
get node info.
Change-Id: I2349e6657d24e1862a7d99d1982f1a3a390b59af
diff --git a/platform/msm_shared/dev_tree.c b/platform/msm_shared/dev_tree.c
old mode 100755
new mode 100644
index 11f9616..1cf358a
--- a/platform/msm_shared/dev_tree.c
+++ b/platform/msm_shared/dev_tree.c
@@ -1318,13 +1318,13 @@
}
if (check_aboot_addr_range_overlap((uint32_t)fdt,
- (fdt_totalsize(fdt) + DTB_PAD_SIZE))) {
+ (fdt_totalsize(fdt) + DTB_PAD_SIZE + strlen(cmdline)))) {
dprintf(CRITICAL, "Error: Fdt addresses overlap with aboot addresses.\n");
return ret;
}
/* Add padding to make space for new nodes and properties. */
- ret = fdt_open_into(fdt, fdt, fdt_totalsize(fdt) + DTB_PAD_SIZE);
+ ret = fdt_open_into(fdt, fdt, fdt_totalsize(fdt) + DTB_PAD_SIZE + strlen(cmdline));
if (ret!= 0)
{
dprintf(CRITICAL, "Failed to move/resize dtb buffer: %d\n", ret);