Skip to content

Commit c79ee4e

Browse files
committed
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>
1 parent aa010ef commit c79ee4e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lib/dma-debug.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ static inline bool overlap(void *addr, u64 size, void *start, void *end)
862862

863863
return ((addr >= start && addr < end) ||
864864
(addr2 >= start && addr2 < end) ||
865-
((addr < start) && (addr2 >= end)));
865+
((addr < start) && (addr2 > end)));
866866
}
867867

868868
static void check_for_illegal_area(struct device *dev, void *addr, u64 size)

0 commit comments

Comments
 (0)