From mboxrd@z Thu Jan 1 00:00:00 1970 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=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 9DA8EC47E4B for ; Wed, 14 Jul 2021 19:52:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F99A6100A for ; Wed, 14 Jul 2021 19:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241697AbhGNTye (ORCPT ); Wed, 14 Jul 2021 15:54:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:45690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240228AbhGNTtg (ORCPT ); Wed, 14 Jul 2021 15:49:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A6C64613D4; Wed, 14 Jul 2021 19:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626291892; bh=Ba38WJGVqGtC8P5d4zPWnHTztyf1aMSimuHwSDGgzEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aajzwjdYVX4j9sXbQq9I5wHWknFYHLk2s6eWK1WedlSsYeQnj8SsLMnxEQ/T6hhv/ QnbUT4cLOhfyCUgA8Y/Fc1IyKpKnY2xNMrqaL/yEXWZjAKKB4lfBq3Tm+pwAZazZZN skJG85btRiaVlOw/9JeXi6qeyDPb2YNcVii5uSgLsamVBNWF92p+ogwG8U6nqAoQU5 gvyYCxNWh4xzsQrekzmuGTCplxnSD1hyt1+ag27KhjBfWLGZnZmU6H/eU8AqWulk8g PRKp5UCTPyYx8e0YJ96hbTsq9c0Y3ZSGzBSKU0cl3KgnpL9ME9DlxK5vkZi0XKJoAo DXkjC6pLfJpDQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Krzysztof Kozlowski , Jacky Bai , Daniel Lezcano , Sasha Levin , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.10 73/88] thermal/drivers/imx_sc: Add missing of_node_put for loop iteration Date: Wed, 14 Jul 2021 15:42:48 -0400 Message-Id: <20210714194303.54028-73-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210714194303.54028-1-sashal@kernel.org> References: <20210714194303.54028-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Krzysztof Kozlowski [ Upstream commit 3da97620e8d60da4a7eaae46e03e0a494780642d ] 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 Signed-off-by: Sasha Levin --- 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 b01d28eca7ee..8d76dbfde6a9 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; } -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 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=-17.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 B015BC12002 for ; Wed, 14 Jul 2021 22:11:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 823D760FF1 for ; Wed, 14 Jul 2021 22:11:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 823D760FF1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xvJzCFbPqm4Fu5ebdNgTSbtKjGGBakvKGewDvrF3tnA=; b=eb8qzaHt4ntr3y WQNQm2DIvtk5jzhX3qWUGFTm+cG67eRiI10ERK6hT1FgmG0bqwDE+GLpBnwYIa9S8zRlbE7Ez8NWP +A38jT0e1q+xWB3px4tOZ2t0Ea8aFtWgp3GQdpjgCcLptmcavijfZjw44A89WDsUNWBfqGXzddZmg YxRiJx2nseYFWXi75Jl6TwWBGk+9uPtGx632XUY0MTrcsTPkIAo+tp63ONfTIaWw064yhqtwjjzNJ 46Ecw4uaaSAysSidyQ7CKgJuTzwlJDttPlwnMTA59HGBecthsGR1QJHaKaeRh2tp0/NKuVesTqu5b yrlOwgdrTBZgpyT+xTiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3n4D-00FiG0-Su; Wed, 14 Jul 2021 22:09:23 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3koO-00EfUD-W6 for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 19:44:54 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id A6C64613D4; Wed, 14 Jul 2021 19:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626291892; bh=Ba38WJGVqGtC8P5d4zPWnHTztyf1aMSimuHwSDGgzEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aajzwjdYVX4j9sXbQq9I5wHWknFYHLk2s6eWK1WedlSsYeQnj8SsLMnxEQ/T6hhv/ QnbUT4cLOhfyCUgA8Y/Fc1IyKpKnY2xNMrqaL/yEXWZjAKKB4lfBq3Tm+pwAZazZZN skJG85btRiaVlOw/9JeXi6qeyDPb2YNcVii5uSgLsamVBNWF92p+ogwG8U6nqAoQU5 gvyYCxNWh4xzsQrekzmuGTCplxnSD1hyt1+ag27KhjBfWLGZnZmU6H/eU8AqWulk8g PRKp5UCTPyYx8e0YJ96hbTsq9c0Y3ZSGzBSKU0cl3KgnpL9ME9DlxK5vkZi0XKJoAo DXkjC6pLfJpDQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Krzysztof Kozlowski , Jacky Bai , Daniel Lezcano , Sasha Levin , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.10 73/88] thermal/drivers/imx_sc: Add missing of_node_put for loop iteration Date: Wed, 14 Jul 2021 15:42:48 -0400 Message-Id: <20210714194303.54028-73-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210714194303.54028-1-sashal@kernel.org> References: <20210714194303.54028-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210714_124453_086219_13906113 X-CRM114-Status: UNSURE ( 9.07 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Krzysztof Kozlowski [ Upstream commit 3da97620e8d60da4a7eaae46e03e0a494780642d ] 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 Signed-off-by: Sasha Levin --- 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 b01d28eca7ee..8d76dbfde6a9 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; } -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel