Skip to content

Commit ad3d5d2

Browse files
toshikiktorvalds
authored andcommitted
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>
1 parent af3cd13 commit ad3d5d2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎lib/genalloc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start,
415415
size_t size)
416416
{
417417
bool found = false;
418-
unsigned long end = start + size;
418+
unsigned long end = start + size - 1;
419419
struct gen_pool_chunk *chunk;
420420

421421
rcu_read_lock();

0 commit comments

Comments
 (0)