Merge remote-tracking branches 'regulator/fix/da9210' and 'regulator/fix/rk808' into...
[linux-drm-fsl-dcu.git] / lib / genalloc.c
index 42a95e99b754b5d3b10afb3283d3a48cea3e0e8d..d214866eeea2cff341cbe76ec0b09c15b05f6ad2 100644 (file)
@@ -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)
@@ -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) {