Skip to content

Commit e2105ca

Browse files
sudeep-hollaarndb
authored andcommitted
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: 3aa0582 ("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>
1 parent 95140ed commit e2105ca

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/of/platform.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,10 @@ static int __init of_platform_default_populate_init(void)
519519
of_platform_device_create(node, NULL, NULL);
520520

521521
node = of_find_node_by_path("/firmware");
522-
if (node)
522+
if (node) {
523523
of_platform_populate(node, NULL, NULL, NULL);
524+
of_node_put(node);
525+
}
524526

525527
/* Populate everything else. */
526528
of_platform_default_populate(NULL, NULL, NULL);

0 commit comments

Comments
 (0)