aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudeep Holla <Sudeep.Holla@arm.com>2018-01-18 05:43:39 -0500
committerArnd Bergmann <arnd@arndb.de>2018-01-23 04:15:11 -0500
commite2105ca8beb0c776a52ae8d18bc6b564745de2e4 (patch)
treed00c06bed8be6ba9e112dca4f42395e1f5121a65
parent95140ed16db560ef86ab4ebe1a4e9b748d098669 (diff)
of: platform: fix OF node refcount leak
We need to call of_node_put() for device nodes obtained with of_find_node_by_path(). Fixes: 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()") Reported-by: Loys Ollivier <lollivier@baylibre.com> Cc: Frank Rowand <frowand.list@gmail.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--drivers/of/platform.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 78cfb15c7890..faf7d87f8833 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -519,8 +519,10 @@ static int __init of_platform_default_populate_init(void)
519 of_platform_device_create(node, NULL, NULL); 519 of_platform_device_create(node, NULL, NULL);
520 520
521 node = of_find_node_by_path("/firmware"); 521 node = of_find_node_by_path("/firmware");
522 if (node) 522 if (node) {
523 of_platform_populate(node, NULL, NULL, NULL); 523 of_platform_populate(node, NULL, NULL, NULL);
524 of_node_put(node);
525 }
524 526
525 /* Populate everything else. */ 527 /* Populate everything else. */
526 of_platform_default_populate(NULL, NULL, NULL); 528 of_platform_default_populate(NULL, NULL, NULL);