Răsfoiți Sursa

[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 <ebiederm@xmission.com>
Acked-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Eric W. Biederman 20 ani în urmă
părinte
comite
48c8b11342
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      arch/x86_64/kernel/e820.c

+ 1 - 1
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; 
 	}