lib/genalloc.c: fix the end addr check in addr_in_gen_pool()

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>
This commit is contained in:
Toshi Kikuchi 2015-02-12 15:02:18 -08:00 committed by Linus Torvalds
parent af3cd13501
commit ad3d5d2f7d

View File

@ -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();