genalloc: fix device node resource counter
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Thu, 25 Sep 2014 23:05:25 +0000 (16:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 26 Sep 2014 15:10:35 +0000 (08:10 -0700)
Decrement the np_pool device_node refcount, which was incremented on
the preceding of_parse_phandle() call.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Olof Johansson <olof@lixom.net>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/genalloc.c

index bdb9a456bcbb50471310b9f636df72c6bc377ddd..38d2db82228c2ce716a68d266efe772e1bc6bc5d 100644 (file)
@@ -588,6 +588,7 @@ struct gen_pool *of_get_named_gen_pool(struct device_node *np,
        if (!np_pool)
                return NULL;
        pdev = of_find_device_by_node(np_pool);
+       of_node_put(np_pool);
        if (!pdev)
                return NULL;
        return dev_get_gen_pool(&pdev->dev);