[tip:core/urgent] dma-debug: fix off-by-one error in overlap function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  c79ee4e466dd12347f112e2af306dca35198458f
Gitweb:     http://git.kernel.org/tip/c79ee4e466dd12347f112e2af306dca35198458f
Author:     Joerg Roedel <joerg.roedel@xxxxxxx>
AuthorDate: Tue, 16 Jun 2009 12:23:58 +0200
Committer:  Joerg Roedel <joerg.roedel@xxxxxxx>
CommitDate: Tue, 16 Jun 2009 12:29:40 +0200

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@xxxxxxxxxx
Reported-by: Andrew Randrianasulu <randrik@xxxxxxx>
Signed-off-by: Joerg Roedel <joerg.roedel@xxxxxxx>


---
 lib/dma-debug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 3b93129..a9b6b5c 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)
 
 	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)
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux