From: Eric W. Biederman Date: Tue, 6 Sep 2005 22:16:20 +0000 (-0700) Subject: [PATCH] x86_64: Fix off by one in e820_mapped X-Git-Tag: v2.6.14-rc1~739 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48c8b1134249432318c8e5d19adc37c45242c4b1;p=linux-2.6 [PATCH] x86_64: Fix off by one in e820_mapped This allows a valid iommu placed immediately after memory to work, to be recognized as after the last byte of memory and not overlapping it. Signed-off-by: Eric W. Biederman Acked-by: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c index b548dea4e5..116ac5f53d 100644 --- a/arch/x86_64/kernel/e820.c +++ b/arch/x86_64/kernel/e820.c @@ -85,7 +85,7 @@ int __init e820_mapped(unsigned long start, unsigned long end, unsigned type) struct e820entry *ei = &e820.map[i]; if (type && ei->type != type) continue; - if (ei->addr >= end || ei->addr + ei->size < start) + if (ei->addr >= end || ei->addr + ei->size <= start) continue; return 1; }