diff options
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 @@ | |||
| 34 | #include <linux/rculist.h> | 34 | #include <linux/rculist.h> |
| 35 | #include <linux/interrupt.h> | 35 | #include <linux/interrupt.h> |
| 36 | #include <linux/genalloc.h> | 36 | #include <linux/genalloc.h> |
| 37 | #include <linux/of_address.h> | ||
| 38 | #include <linux/of_device.h> | 37 | #include <linux/of_device.h> |
| 39 | 38 | ||
| 40 | static inline size_t chunk_size(const struct gen_pool_chunk *chunk) | 39 | 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, | |||
| 415 | size_t size) | 414 | size_t size) |
| 416 | { | 415 | { |
| 417 | bool found = false; | 416 | bool found = false; |
| 418 | unsigned long end = start + size; | 417 | unsigned long end = start + size - 1; |
| 419 | struct gen_pool_chunk *chunk; | 418 | struct gen_pool_chunk *chunk; |
| 420 | 419 | ||
| 421 | rcu_read_lock(); | 420 | rcu_read_lock(); |
| @@ -587,6 +586,8 @@ struct gen_pool *devm_gen_pool_create(struct device *dev, int min_alloc_order, | |||
| 587 | struct gen_pool **ptr, *pool; | 586 | struct gen_pool **ptr, *pool; |
| 588 | 587 | ||
| 589 | ptr = devres_alloc(devm_gen_pool_release, sizeof(*ptr), GFP_KERNEL); | 588 | ptr = devres_alloc(devm_gen_pool_release, sizeof(*ptr), GFP_KERNEL); |
| 589 | if (!ptr) | ||
| 590 | return NULL; | ||
| 590 | 591 | ||
| 591 | pool = gen_pool_create(min_alloc_order, nid); | 592 | pool = gen_pool_create(min_alloc_order, nid); |
| 592 | if (pool) { | 593 | if (pool) { |
