Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c79ee4e4 authored by Joerg Roedel's avatar Joerg Roedel
Browse files

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: default avatarAndrew Randrianasulu <randrik@mail.ru>
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent aa010efb
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -862,7 +862,7 @@ static inline bool overlap(void *addr, u64 size, void *start, void *end)


	return ((addr >= start && addr < end) ||
	return ((addr >= start && addr < end) ||
		(addr2 >= start && addr2 < 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)
static void check_for_illegal_area(struct device *dev, void *addr, u64 size)