Skip to content

Commit

Permalink
lib/genalloc.c: fix the end addr check in addr_in_gen_pool()
Browse files Browse the repository at this point in the history
Since chunk->end_addr is (chunk->start_addr + size - 1), the end address
to compare should be (start + size - 1).

Signed-off-by: Toshi Kikuchi <toshik@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
toshikik authored and torvalds committed Feb 13, 2015
1 parent af3cd13 commit ad3d5d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/genalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start,
size_t size)
{
bool found = false;
unsigned long end = start + size;
unsigned long end = start + size - 1;
struct gen_pool_chunk *chunk;

rcu_read_lock();
Expand Down

0 comments on commit ad3d5d2

Please sign in to comment.