mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 20:51:44 +00:00
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: 3aa0582fdb
("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>
This commit is contained in:
parent
95140ed16d
commit
e2105ca8be
@ -519,8 +519,10 @@ static int __init of_platform_default_populate_init(void)
|
||||
of_platform_device_create(node, NULL, NULL);
|
||||
|
||||
node = of_find_node_by_path("/firmware");
|
||||
if (node)
|
||||
if (node) {
|
||||
of_platform_populate(node, NULL, NULL, NULL);
|
||||
of_node_put(node);
|
||||
}
|
||||
|
||||
/* Populate everything else. */
|
||||
of_platform_default_populate(NULL, NULL, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user