diff options
author | Aaro Koskinen <aaro.koskinen@iki.fi> | 2012-10-16 19:35:14 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-10-18 11:05:19 +0100 |
commit | 2456f44dd7a9aaffc2cd21a13f78198b3d94da08 (patch) | |
tree | bbb4f265529b0e1f27bc8fba817b6d64c4332146 /arch/arm | |
parent | ddffeb8c4d0331609ef2581d84de4d763607bd37 (diff) | |
download | op-kernel-dev-2456f44dd7a9aaffc2cd21a13f78198b3d94da08.zip op-kernel-dev-2456f44dd7a9aaffc2cd21a13f78198b3d94da08.tar.gz |
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 <will.deacon@arm.com>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kernel/machine_kexec.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index e29c333..8ef8c93 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) |