]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.30.2/dma-debug-fix-off-by-one-error-in-overlap-function.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 2.6.30.2 / dma-debug-fix-off-by-one-error-in-overlap-function.patch
1 From c79ee4e466dd12347f112e2af306dca35198458f Mon Sep 17 00:00:00 2001
2 From: Joerg Roedel <joerg.roedel@amd.com>
3 Date: Tue, 16 Jun 2009 12:23:58 +0200
4 Subject: dma-debug: fix off-by-one error in overlap function
5
6 From: Joerg Roedel <joerg.roedel@amd.com>
7
8 commit c79ee4e466dd12347f112e2af306dca35198458f upstream.
9
10 This patch fixes a bug in the overlap function which returned true if
11 one region ends exactly before the second region begins. This is no
12 overlap but the function returned true in that case.
13
14 Reported-by: Andrew Randrianasulu <randrik@mail.ru>
15 Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17
18 ---
19 lib/dma-debug.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22 --- a/lib/dma-debug.c
23 +++ b/lib/dma-debug.c
24 @@ -599,7 +599,7 @@ static inline bool overlap(void *addr, u
25
26 return ((addr >= start && addr < end) ||
27 (addr2 >= start && addr2 < end) ||
28 - ((addr < start) && (addr2 >= end)));
29 + ((addr < start) && (addr2 > end)));
30 }
31
32 static void check_for_illegal_area(struct device *dev, void *addr, u64 size)