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,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 D7737C47E52 for ; Wed, 14 Jul 2021 19:42:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C2EF6613CF for ; Wed, 14 Jul 2021 19:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236197AbhGNTpS (ORCPT ); Wed, 14 Jul 2021 15:45:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:38880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233694AbhGNTnE (ORCPT ); Wed, 14 Jul 2021 15:43:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 80FE3613E7; Wed, 14 Jul 2021 19:40:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626291612; bh=Ba38WJGVqGtC8P5d4zPWnHTztyf1aMSimuHwSDGgzEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CxjKPBvMcLFOVrIfGPF+5cWXripk+sCkyGZa7TLV08QLRAJ0WWeJfq1xRB1jLxlo/ rN0aI9Fhq7bAKfcEYw+YLqJCa5rdpkqilMXnTJQ39vELOOn8mPfygE8FQxy4Hy+T6s VidfEHCPbJvU6DT03FUwRmhwwyz2FNQjxYu3VWcSsvHjm5Dceb3tUWcp3NGPPFTf1H VqiDJZ0spaebb96Ejsg0FbOQ2AfZa+YxLOv3bdgjIMGR9lxxI4Vu9xKNSqRGv48kmF N8VTUTeJnGK5n2X7t7q62ax4VJo5gzyq/m7vJ7wQEqbz/1zi7AqI5f2bZ2skcTZeG0 sPMlAodkE6NTw== 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.13 091/108] thermal/drivers/imx_sc: Add missing of_node_put for loop iteration Date: Wed, 14 Jul 2021 15:37:43 -0400 Message-Id: <20210714193800.52097-91-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210714193800.52097-1-sashal@kernel.org> References: <20210714193800.52097-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 41ED1C12002 for ; Wed, 14 Jul 2021 20:35:26 +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 ED72261370 for ; Wed, 14 Jul 2021 20:35:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED72261370 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=FE6NKW1lgkgpwN e8o+RGoL3coQJzI0SFKoY09rgP1QVcAF3C6SJASIp6DSXbKpF9g22PF+UrddtWzTjj5Onf8wvSHJB h6ONZl3VmqeT2M4zIWT+cAtBL5vNUx90sKF/nR5DP03W8u6Pw+gjwJbx2M2lKO94BftcX6fYHLCcb UI0g0Fvc2vTXya6XYjuCbm35KQhqIA+lGROj62s5zWTOjfUk36IONUBnRCMw4CO3G4gUCmGBiHb7y 8vj9zGmVIHF7psVzdlDti0NSJa0q83frhYZu7j9WuhdWWS/I31d7hRbdt71GsFPstgQA7tRJxm2Tq Rny/MgguwbZCQeLYhpCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3lZA-00F1cK-Up; Wed, 14 Jul 2021 20:33:13 +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 1m3kjs-00Ecos-RR for linux-arm-kernel@lists.infradead.org; Wed, 14 Jul 2021 19:40:14 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 80FE3613E7; Wed, 14 Jul 2021 19:40:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626291612; bh=Ba38WJGVqGtC8P5d4zPWnHTztyf1aMSimuHwSDGgzEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CxjKPBvMcLFOVrIfGPF+5cWXripk+sCkyGZa7TLV08QLRAJ0WWeJfq1xRB1jLxlo/ rN0aI9Fhq7bAKfcEYw+YLqJCa5rdpkqilMXnTJQ39vELOOn8mPfygE8FQxy4Hy+T6s VidfEHCPbJvU6DT03FUwRmhwwyz2FNQjxYu3VWcSsvHjm5Dceb3tUWcp3NGPPFTf1H VqiDJZ0spaebb96Ejsg0FbOQ2AfZa+YxLOv3bdgjIMGR9lxxI4Vu9xKNSqRGv48kmF N8VTUTeJnGK5n2X7t7q62ax4VJo5gzyq/m7vJ7wQEqbz/1zi7AqI5f2bZ2skcTZeG0 sPMlAodkE6NTw== 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.13 091/108] thermal/drivers/imx_sc: Add missing of_node_put for loop iteration Date: Wed, 14 Jul 2021 15:37:43 -0400 Message-Id: <20210714193800.52097-91-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210714193800.52097-1-sashal@kernel.org> References: <20210714193800.52097-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_124012_982990_BBD53F39 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