提交 c79ee4e4 编写于 作者: J Joerg Roedel

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: NAndrew Randrianasulu <randrik@mail.ru>
Signed-off-by: NJoerg Roedel <joerg.roedel@amd.com>
上级 aa010efb
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册