summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-06-16 12:23:58 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-07-19 20:38:51 -0700
commit1d13d53f580ce84783fc7de8a25a978b47c53757 (patch)
treea968d76526916ec022b7c2c483e2ea92157da072 /lib
parent6006f5048e1a766e7a1ca012d7f17f061b2e8dfe (diff)
dma-debug: fix off-by-one error in overlap function
commit c79ee4e466dd12347f112e2af306dca35198458f upstream. This patch fixes a bug in the overlap function which returned true if one region ends exactly before the second region begins. This is no overlap but the function returned true in that case. Reported-by: Andrew Randrianasulu <randrik@mail.ru> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/dma-debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 2b165363bd33..6a4e3d41ad6d 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -599,7 +599,7 @@ static inline bool overlap(void *addr, u64 size, void *start, void *end)
return ((addr >= start && addr < end) ||
(addr2 >= start && addr2 < end) ||
- ((addr < start) && (addr2 >= end)));
+ ((addr < start) && (addr2 > end)));
}
static void check_for_illegal_area(struct device *dev, void *addr, u64 size)