lib/genalloc.c: fix the end addr check in addr_in_gen_pool()
[firefly-linux-kernel-4.4.55.git] / lib / genalloc.c
index 2e65d206b01c13d3ad02a57c3d0842b89c8637bd..42a95e99b754b5d3b10afb3283d3a48cea3e0e8d 100644 (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();