From: Aaro Koskinen Date: Tue, 16 Oct 2012 18:35:14 +0000 (+0100) Subject: ARM: 7555/1: kexec: fix segment memory addresses check X-Git-Tag: firefly_0821_release~3680^2~1584^2~12 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2456f44dd7a9aaffc2cd21a13f78198b3d94da08;p=firefly-linux-kernel-4.4.55.git ARM: 7555/1: kexec: fix segment memory addresses check Commit c564df4db85aac8d1d65a56176a0a25f46138064 (ARM: 7540/1: kexec: Check segment memory addresses) added a safety check with accidentally reversed condition, and broke kexec functionality on ARM. Fix this. Acked-by: Will Deacon Signed-off-by: Aaro Koskinen Signed-off-by: Russell King --- diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index e29c3337ca81..8ef8c9337809 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c @@ -45,10 +45,9 @@ int machine_kexec_prepare(struct kimage *image) for (i = 0; i < image->nr_segments; i++) { current_segment = &image->segment[i]; - err = memblock_is_region_memory(current_segment->mem, - current_segment->memsz); - if (err) - return - EINVAL; + if (!memblock_is_region_memory(current_segment->mem, + current_segment->memsz)) + return -EINVAL; err = get_user(header, (__be32*)current_segment->buf); if (err)