From patchwork Thu Jan 18 10:43:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 124927 Delivered-To: patch@linaro.org Received: by 10.46.64.27 with SMTP id n27csp71001lja; Thu, 18 Jan 2018 02:43:50 -0800 (PST) X-Google-Smtp-Source: ACJfBosXWtx7zAK2/3W6rAfQfxtIrk7KtR6bzs7gwoxpFDAE9WmpRfO1L2dzAxMTspYieDxhUc0/ X-Received: by 10.98.74.133 with SMTP id c5mr29936582pfj.188.1516272229973; Thu, 18 Jan 2018 02:43:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516272229; cv=none; d=google.com; s=arc-20160816; b=XYtS5rTZM4AbfC2yBZ3a0a+xbQn+lW9TBqiVVitGIlwb8jxzP2xYehEaspaa1V0cTp wkZCSFAEKSCZjkN3/eqlSd1fQ1uk3QyCrNyZWcUe0Z+ffMC256pY7bRiF5rQzKmI7FLd Krhc4uJNPpMpXoOLeS0+qYoUCpkQfbqCVr7TQeAMoEY/wQN3T9M2Mh/381Nh7DUsJul3 rhm7gH5sTFA9VTnTKMWPnPvkTZgvM0CGvZ/aRhK9beIKO0i8IRcanY2xLecWCVYbCtgj qxuD8vQBwBHl58hJ50W6cLn0tRvLiXaZQI3oFBbkw+LtMwA8hUaNv6r4JQRco2KVH3XI I7Og== 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=RoWqifqUwGakizXQJQARyeHxp1EuU4fypfwJ6+JhAcs=; b=g6ZSJTpOzj1+xKDT3zxVOYHezYVT9iOsVtNVOrkuHfNC35NgUYEinvbrhuBxaO+vUb oIr/RVdZYjlh2LA+OpvGEsTLUyccPJaeRtf5hcwZJx3+KGg2UyygQk+6SIpQFllRZeAq 43NmCEbVdApbAlVe1CeRepYOX2mvi6YOpsUiDR7uaMHAIVmFt9EjS8FUE2X+x0lHwn/w /gdCIAs13LJiMED3q0MyVhjswkzNslgB7nh6SdG11sKeyH+g1HmY0aWQyRimodoeUH+B /a26hbWPzWv0Sdj5sj+p6Lwwe/gW5SkSEYJnr2NwRcbaPSy+ZueeQudKdLd2ejYzKW0E yUrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-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 b4si1686156pgq.646.2018.01.18.02.43.49; Thu, 18 Jan 2018 02:43:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755329AbeARKns (ORCPT + 6 others); Thu, 18 Jan 2018 05:43:48 -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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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 -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Rob Herring 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);