[S390] vmemmap: fix off-by-one bug.
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 10 Jun 2008 08:03:20 +0000 (10:03 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 10 Jun 2008 08:03:27 +0000 (10:03 +0200)
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>
arch/s390/mm/vmem.c

index f591188..e4868bf 100644 (file)
@@ -236,7 +236,7 @@ static int insert_memory_segment(struct memory_segment *seg)
 {
        struct memory_segment *tmp;
 
-       if (seg->start + seg->size >= VMEM_MAX_PHYS ||
+       if (seg->start + seg->size > VMEM_MAX_PHYS ||
            seg->start + seg->size < seg->start)
                return -ERANGE;