Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2105ca8 authored by Sudeep Holla's avatar Sudeep Holla Committed by Arnd Bergmann
Browse files

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: 3aa0582f ("of: platform: populate /firmware/ node from of_platform_default_populate_init()")
Reported-by: default avatarLoys Ollivier <lollivier@baylibre.com>
Cc: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Acked-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarAndy Gross <andy.gross@linaro.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 95140ed1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);