Skip to content

Commit

Permalink
dma-debug: fix off-by-one error in overlap function
Browse files Browse the repository at this point in the history
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: [email protected]
Reported-by: Andrew Randrianasulu <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
  • Loading branch information
Joerg Roedel committed Jun 16, 2009
1 parent aa010ef commit c79ee4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dma-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c79ee4e

Please sign in to comment.