提交 ad3d5d2f 编写于 作者: T Toshi Kikuchi 提交者: Linus Torvalds

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: NToshi Kikuchi <toshik@chromium.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 af3cd135
...@@ -415,7 +415,7 @@ bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start, ...@@ -415,7 +415,7 @@ bool addr_in_gen_pool(struct gen_pool *pool, unsigned long start,
size_t size) size_t size)
{ {
bool found = false; bool found = false;
unsigned long end = start + size; unsigned long end = start + size - 1;
struct gen_pool_chunk *chunk; struct gen_pool_chunk *chunk;
rcu_read_lock(); rcu_read_lock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册