From: Sudeep Holla Date: Thu, 18 Jan 2018 10:43:39 +0000 (+0000) Subject: of: platform: fix OF node refcount leak X-Git-Tag: v5.15~9497^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e2105ca8beb0c776a52ae8d18bc6b564745de2e4;p=platform%2Fkernel%2Flinux-starfive.git 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 Cc: Frank Rowand Signed-off-by: Sudeep Holla Acked-by: Rob Herring Signed-off-by: Andy Gross Signed-off-by: Arnd Bergmann --- diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 78cfb15..faf7d87 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -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);