From: Heiko Carstens Date: Tue, 10 Jun 2008 08:03:20 +0000 (+0200) Subject: [S390] vmemmap: fix off-by-one bug. X-Git-Tag: v2.6.26-rc6~16^2~5 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee0ddadd086e25503f81be551c43f66472300acd;p=linux-2.6 [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 Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index f591188fa2..e4868bfc67 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) { 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;