diff options
author | Toshi Kikuchi <toshik@chromium.org> | 2015-02-13 00:02:18 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-13 03:54:14 +0100 |
commit | ad3d5d2f7deca6d0fd72163573bcb0cca6337e33 (patch) | |
tree | 42b109baf3a0121d702964fd5411d9ac0cd168f4 /lib | |
parent | lib/string.c: remove strnicmp() (diff) | |
download | linux-ad3d5d2f7deca6d0fd72163573bcb0cca6337e33.tar.xz linux-ad3d5d2f7deca6d0fd72163573bcb0cca6337e33.zip |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/genalloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
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(); |