diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-04-14 08:51:33 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-04-14 08:51:33 -0700 |
| commit | 85a3685852d9ac7d92be9d824533c915a4597fa4 (patch) | |
| tree | b7c542e2061cf96c9f7ad500fa12567f9ff0b39f /lib/genalloc.c | |
| parent | 92bac83dd79e60e65c475222e41a992a70434beb (diff) | |
| parent | 8b8a518ef16be2de27207991e32fc32b0475c767 (diff) | |
Merge branch 'next' into for-linus
Prepare first round of input updates for 4.1 merge window.
Diffstat (limited to 'lib/genalloc.c')
| -rw-r--r-- | lib/genalloc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/genalloc.c b/lib/genalloc.c index 2e65d206b01c..d214866eeea2 100644 --- a/lib/genalloc.c +++ b/lib/genalloc.c @@ -34,7 +34,6 @@ #include <linux/rculist.h> #include <linux/interrupt.h> #include <linux/genalloc.h> -#include <linux/of_address.h> #include <linux/of_device.h> static inline size_t chunk_size(const struct gen_pool_chunk *chunk) @@ -415,7 +414,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(); @@ -587,6 +586,8 @@ struct gen_pool *devm_gen_pool_create(struct device *dev, int min_alloc_order, struct gen_pool **ptr, *pool; ptr = devres_alloc(devm_gen_pool_release, sizeof(*ptr), GFP_KERNEL); + if (!ptr) + return NULL; pool = gen_pool_create(min_alloc_order, nid); if (pool) { |
