diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-06-10 04:03:20 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-06-10 04:03:27 -0400 |
commit | ee0ddadd086e25503f81be551c43f66472300acd (patch) | |
tree | 0f1606c133835abd3952af30efcee03230182139 /arch | |
parent | 12829126aa47758608578cc5be3a5adffc3d4b09 (diff) |
[S390] vmemmap: fix off-by-one bug.
If a memory range is supposed to be added to the 1:1 mapping and it
ends just below the maximum supported physical address it won't
succeed. This is because a test doesn't consider that the end address
is 1 smaller than start + size.
Fix the comparison.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/mm/vmem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index f591188fa2c0..e4868bfc672f 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c | |||
@@ -236,7 +236,7 @@ static int insert_memory_segment(struct memory_segment *seg) | |||
236 | { | 236 | { |
237 | struct memory_segment *tmp; | 237 | struct memory_segment *tmp; |
238 | 238 | ||
239 | if (seg->start + seg->size >= VMEM_MAX_PHYS || | 239 | if (seg->start + seg->size > VMEM_MAX_PHYS || |
240 | seg->start + seg->size < seg->start) | 240 | seg->start + seg->size < seg->start) |
241 | return -ERANGE; | 241 | return -ERANGE; |
242 | 242 | ||