Skip to content

Commit

Permalink
ARM: 7555/1: kexec: fix segment memory addresses check
Browse files Browse the repository at this point in the history
Commit c564df4 (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>
  • Loading branch information
Aaro Koskinen authored and Russell King committed Oct 18, 2012
1 parent ddffeb8 commit 2456f44
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions arch/arm/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2456f44

Please sign in to comment.