From 943ba35f8143408d8ada9a24d0986663cc612df9 Mon Sep 17 00:00:00 2001 From: Liu Hua Date: Wed, 23 Jul 2014 19:20:34 +0800 Subject: kexec: align the extended size of dtb 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 Signed-off-by: Simon Horman --- 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) { -- cgit v1.2.1