From: Toshi Kikuchi Date: Thu, 12 Feb 2015 23:02:18 +0000 (-0800) Subject: lib/genalloc.c: fix the end addr check in addr_in_gen_pool() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ad3d5d2f7deca6d0fd72163573bcb0cca6337e33;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/genalloc.c b/lib/genalloc.c index 2e65d206b01c..42a95e99b754 100644 --- a/lib/genalloc.c +++ b/lib/genalloc.c @@ -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();