[PATCH] kexec: align the extended size of dtb

Liu Hua sdu.liu at huawei.com
Wed Jul 23 04:20:34 PDT 2014


When loading dtb on arm platform, we may need change strings in dtb
in function setup_dtb_prop. If length of new string is larger than that
of the old one. We should extend the dtb by "FDT_TAGALIGN"ed size.
If not, kexec may fail to load the capture kernel.

Signed-off-by: Liu Hua <sdu.liu at huawei.com>
---
 kexec/arch/arm/kexec-zImage-arm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c
index 44b87bb..ff4e38d 100644
--- a/kexec/arch/arm/kexec-zImage-arm.c
+++ b/kexec/arch/arm/kexec-zImage-arm.c
@@ -259,7 +259,7 @@ static int setup_dtb_prop(char **bufp, off_t *sizep, const char *node_name,
 		dtb_size += fdt_prop_len(prop_name, len);
 	} else {
 		if (prop_len < len)
-			dtb_size += len - prop_len;
+			dtb_size += FDT_TAGALIGN(len - prop_len);
 	}
 
 	if (fdt_totalsize(dtb_buf) < dtb_size) {
-- 
1.9.0




More information about the kexec mailing list