From patchwork Mon Jun 21 09:46:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thermal-bot for Julien Panis X-Patchwork-Id: 464815 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFC17C49EA3 for ; Mon, 21 Jun 2021 09:47:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D5D7A60FF4 for ; Mon, 21 Jun 2021 09:47:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229888AbhFUJtX (ORCPT ); Mon, 21 Jun 2021 05:49:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230496AbhFUJtF (ORCPT ); Mon, 21 Jun 2021 05:49:05 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24FA8C061766 for ; Mon, 21 Jun 2021 02:46:51 -0700 (PDT) Date: Mon, 21 Jun 2021 09:46:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1624268806; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qYh0CpdHqLUj8PIJIBu81/Laa3X15entcmSp/KJlDQE=; b=OTQB6hoV1SueheO+8yR31tjs4PeKk2wz9bI5v9a3XW6lWb9QPoEvbazFDHWuEiB36ecM/D waWHGjW1jJ5zqauBIQvAFy04DYtjMYIr+9XNCsSQ7ZFom1hO9AjkB63Vtaf93Jf6ZQTOru /lKXX3p0MXqRYnbc4P7rQ5h8maszJP1wWAHiYCrxDYQYfKokp/ncO8Olbn6IXkKZL2yYGs 8dyxy2dvTCmM8XCsagU0vG5OC8CFbOtBDiDe36zGqSPAsI+SPlpd8CnpuXqCrhsJIEUCOT OL2c5yeHy+v7sqzScRCTLp3yTqc0am1ObjxwAmuYdvMV4Iw1z6Ye0mhA0K674A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1624268806; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qYh0CpdHqLUj8PIJIBu81/Laa3X15entcmSp/KJlDQE=; b=1EGyE7PoN/7hnslHtD406VE0WfS0rpEBJdYmes2R/jBlptJYyfEt7tdk4AjY7NfABaiV5G 7voqB3gguAVXqcAQ== From: "thermal-bot for Krzysztof Kozlowski" Sender: tip-bot2@linutronix.de Reply-to: linux-pm@vger.kernel.org To: linux-pm@vger.kernel.org Subject: [thermal: thermal/next] thermal/drivers/imx_sc: Add missing of_node_put for loop iteration Cc: Krzysztof Kozlowski , Jacky Bai , Daniel Lezcano , rui.zhang@intel.com, amitk@kernel.org In-Reply-To: <20210614192230.19248-1-krzysztof.kozlowski@canonical.com> References: <20210614192230.19248-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Message-ID: <162426880551.395.2061660206973556225.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The following commit has been merged into the thermal/next branch of thermal: Commit-ID: 3da97620e8d60da4a7eaae46e03e0a494780642d Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//3da97620e8d60da4a7eaae46e03e0a494780642d Author: Krzysztof Kozlowski AuthorDate: Mon, 14 Jun 2021 21:22:29 +02:00 Committer: Daniel Lezcano CommitterDate: Mon, 14 Jun 2021 22:41:00 +02:00 thermal/drivers/imx_sc: Add missing of_node_put for loop iteration Early exits from for_each_available_child_of_node() should decrement the node reference counter. Reported by Coccinelle: drivers/thermal/imx_sc_thermal.c:93:1-33: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 97. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jacky Bai Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210614192230.19248-1-krzysztof.kozlowski@canonical.com --- drivers/thermal/imx_sc_thermal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c index b01d28e..8d76dbf 100644 --- a/drivers/thermal/imx_sc_thermal.c +++ b/drivers/thermal/imx_sc_thermal.c @@ -93,6 +93,7 @@ static int imx_sc_thermal_probe(struct platform_device *pdev) for_each_available_child_of_node(np, child) { sensor = devm_kzalloc(&pdev->dev, sizeof(*sensor), GFP_KERNEL); if (!sensor) { + of_node_put(child); of_node_put(sensor_np); return -ENOMEM; } @@ -104,6 +105,7 @@ static int imx_sc_thermal_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to get valid sensor resource id: %d\n", ret); + of_node_put(child); break; } @@ -114,6 +116,7 @@ static int imx_sc_thermal_probe(struct platform_device *pdev) if (IS_ERR(sensor->tzd)) { dev_err(&pdev->dev, "failed to register thermal zone\n"); ret = PTR_ERR(sensor->tzd); + of_node_put(child); break; }