summaryrefslogtreecommitdiff
path: root/kexec/arch/arm/kexec-zImage-arm.c
diff options
context:
space:
mode:
authorRussell King <rmk@armlinux.org.uk>2016-06-17 20:44:42 +0100
committerSimon Horman <horms@verge.net.au>2016-06-23 09:40:58 +0900
commit4db7f295d59651ead1f7632198fe8c113a2e8890 (patch)
tree572168a3c9864ee7f5b264fba1e3be61d5021f7c /kexec/arch/arm/kexec-zImage-arm.c
parentfe9b19d49be88e771a06ee4519d420db946ae3f3 (diff)
arm: fix kernel image size
If we want to assume that the compressed image will expand by a maximum of 4x, we actually need to reserve 5x the space, since we need to keep a copy of the compessed image around while decompressing. Signed-off-by: Russell King <rmk@armlinux.org.uk> Reviewed-by: Pratyush Anand <panand@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/arm/kexec-zImage-arm.c')
-rw-r--r--kexec/arch/arm/kexec-zImage-arm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c
index 297b7fd..9400d1f 100644
--- a/kexec/arch/arm/kexec-zImage-arm.c
+++ b/kexec/arch/arm/kexec-zImage-arm.c
@@ -526,8 +526,10 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,
initrd_base = kernel_base + _ALIGN(kexec_arm_image_size, getpagesize());
} else {
/* Otherwise, assume the maximum kernel compression ratio
- * is 4, and just to be safe, place ramdisk after that */
- initrd_base = kernel_base + _ALIGN(len * 4, getpagesize());
+ * is 4, and just to be safe, place ramdisk after that.
+ * Note that we must include space for the compressed
+ * image here as well. */
+ initrd_base = kernel_base + _ALIGN(len * 5, getpagesize());
}
if (use_atags) {