From: Joerg Roedel Date: Tue, 16 Jun 2009 10:23:58 +0000 (+0200) Subject: dma-debug: fix off-by-one error in overlap function X-Git-Tag: v2.6.30.2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d13d53f580ce84783fc7de8a25a978b47c53757;p=thirdparty%2Fkernel%2Fstable.git 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 Signed-off-by: Joerg Roedel Signed-off-by: Greg Kroah-Hartman --- diff --git a/lib/dma-debug.c b/lib/dma-debug.c index 2b165363bd334..6a4e3d41ad6df 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)