Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kexec: align the extended size of dtb
@ 2014-07-23 11:20 Liu Hua
  2014-07-24  8:12 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Hua @ 2014-07-23 11:20 UTC (permalink / raw)
  To: horms; +Cc: wangnan0, kexec, peifeiyue, Liu Hua

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@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


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-24  8:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-23 11:20 [PATCH] kexec: align the extended size of dtb Liu Hua
2014-07-24  8:12 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox