aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-06-16 06:23:58 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2009-06-16 06:29:40 -0400
commitc79ee4e466dd12347f112e2af306dca35198458f (patch)
tree42c7a2fede416d9702a5affcf68ea198372590db /lib
parentaa010efb7b6cd0dfbea8ecf37a6ab587dc2a8560 (diff)
dma-debug: fix off-by-one error in overlap function
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. Cc: stable@kernel.org Reported-by: Andrew Randrianasulu <randrik@mail.ru> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
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 3b93129a968c..a9b6b5c9e091 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -862,7 +862,7 @@ static inline bool overlap(void *addr, u64 size, void *start, void *end)
862 862
863 return ((addr >= start && addr < end) || 863 return ((addr >= start && addr < end) ||
864 (addr2 >= start && addr2 < end) || 864 (addr2 >= start && addr2 < end) ||
865 ((addr < start) && (addr2 >= end))); 865 ((addr < start) && (addr2 > end)));
866} 866}
867 867
868static void check_for_illegal_area(struct device *dev, void *addr, u64 size) 868static void check_for_illegal_area(struct device *dev, void *addr, u64 size)