Received: by 10.223.148.5 with SMTP id 5csp7232253wrq; Thu, 18 Jan 2018 02:45:14 -0800 (PST) X-Google-Smtp-Source: ACJfBounyfqteqSF5Grd5hvSEtY2uusjrUKWoslPU+E3gC7I6z2WKKU7Sjg00bLAvgf0Lmp/N+un X-Received: by 10.84.172.195 with SMTP id n61mr2094726plb.440.1516272314698; Thu, 18 Jan 2018 02:45:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516272314; cv=none; d=google.com; s=arc-20160816; b=yHUqh4m24NYED8WsWol5UxxZSuuAIv1ERDh0vL8n/XEii+UOyELQrZOQT/Z3bAmfZh 1JIY8AvQLGQIxiJoe/t7hczLTgOspiBZ7R/1wmfWru5gI9Pn04jD7wSR8w2BLXVGOqmO zMjWKml3b8FapBQ+Mfash5ffFW7/q6k6bgop2otAYi4XfAb5+xPd2M6+BGc0mCdlfYGE zYPC/25VlMo9kROdpZwdvNz9C0Z4XjbnExqym7HaDi56sUzDK4Rko3e4OZrOPpjUchd/ KyA6ICR75+HENQ8qnSCGdk1eTIrEskCS2EWirtgBQ2TThDVjnbmFxvhMAPaxgo6lsTvG QwKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=aPWAtHv5oLqvOTmYiYYyNS+Nzk4kvy9POd/kTWvvTyI=; b=E5VPUMp4ziLWe36jG0i3n6or+oMSdkmN3gd4gEqRovKsHOlHZnzC7OTTCi/NdzYNqF sS4rph1RDz1qZDwXeWbvGFOhEnSpd0AYQ+k94VxmuHWcvf+A0svf3WxK2A6lEUXF47KM IsHoQ4rhAwoi9t+C8Dgx16XJ8ob9uH/C8jgOb9FuuW4DV5as1aDaiOB/sVO2zaGceBMn 9DVXBVItIH3lkB8p/A+IHX0b8QYbAiWfV4zHZdNxHEuabchfJjYU1qDFh544CDj1BUzw XMfx1x0uZ5NIkrt1WWTTU08ALUVqsxC26uVPgfQaHkiJetyjGoQetXBmFGHmtonNOiNk zmzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h82si6369654pfd.219.2018.01.18.02.45.00; Thu, 18 Jan 2018 02:45:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755881AbeARKnt (ORCPT + 99 others); Thu, 18 Jan 2018 05:43:49 -0500 Received: from foss.arm.com ([217.140.101.70]:53054 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755015AbeARKns (ORCPT ); Thu, 18 Jan 2018 05:43:48 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D09C01529; Thu, 18 Jan 2018 02:43:47 -0800 (PST) Received: from e107155-lin.cambridge.arm.com (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4DA433F557; Thu, 18 Jan 2018 02:43:46 -0800 (PST) From: Sudeep Holla To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sudeep Holla , Loys Ollivier , Andy Gross , Bjorn Andersson , Rob Herring , Frank Rowand Subject: [PATCH -next] of: platform: fix OF node refcount leak Date: Thu, 18 Jan 2018 10:43:39 +0000 Message-Id: <1516272219-25359-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Rob Herring Cc: Frank Rowand Signed-off-by: Sudeep Holla --- drivers/of/platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Hi Rob, You had Acked the original patch and it's queued via ARM SoC. So can you please provide ack on this if you are OK with the change. Regards, Sudeep diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 6a01dab597c7..c00d81dfac0b 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -514,8 +514,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); -- 2.7.4