For the allocation, using CRASH_MAX_MEMMAP_NR instead of KEXEC_MAX_SEGMENTS + 1 seems more understandable. Signed-off-by: Zhang Yanfei <zhangyanfei at cn.fujitsu.com> --- kexec/arch/i386/crashdump-x86.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c index 245402c..e4b8be3 100644 --- a/kexec/arch/i386/crashdump-x86.c +++ b/kexec/arch/i386/crashdump-x86.c @@ -975,7 +975,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline, return -1; /* Memory regions which panic kernel can safely use to boot into */ - sz = (sizeof(struct memory_range) * (KEXEC_MAX_SEGMENTS + 1)); + sz = (sizeof(struct memory_range) * CRASH_MAX_MEMMAP_NR); memmap_p = xmalloc(sz); memset(memmap_p, 0, sz); add_memmap(memmap_p, info->backup_src_start, info->backup_src_size); -- 1.7.1