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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73D07C433EF for ; Tue, 18 Jan 2022 03:47:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351948AbiARDrG (ORCPT ); Mon, 17 Jan 2022 22:47:06 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:50064 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347181AbiARCkz (ORCPT ); Mon, 17 Jan 2022 21:40:55 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B8D13B811D6; Tue, 18 Jan 2022 02:40:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 841E4C36AEF; Tue, 18 Jan 2022 02:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642473652; bh=k/Lz/Zo8RSedFrd/Cb57u0V3RMctMpavMVRb8b8/edc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ezn2DdYM0M9srU2XJ8dHOC5UAZ1VipoXDgDOc+Wi6uNDHIRnQGga4PEtR7Ea1zwFh O9aCOCLEo+EX21eCQR6z/T9zuE3T9Zx7Hs42ddrvcTxyZYInatFtK04OugKbDnWir4 gsbtMtIoEpwHaed6KNg8QLlqTU0TA+ufi7RqX2EZZMUh/y0pfMidVPc782cuD7H0Re VBDagUW3+etNBTpgKq9OWtjr03KhZYY64ySn3pzXJseqYM5QFyCI1t6BVFkK9pLS0d XHUBVVrLGGmoWWrvzVFgD0iCGX7l28pZpuXBY4lImceaovSElD27oFPF8jUl+qGVAV 5hpnfGjjfPh5A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wan Jiabing , Geert Uytterhoeven , Sasha Levin , magnus.damm@gmail.com, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 012/116] ARM: shmobile: rcar-gen2: Add missing of_node_put() Date: Mon, 17 Jan 2022 21:38:23 -0500 Message-Id: <20220118024007.1950576-12-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118024007.1950576-1-sashal@kernel.org> References: <20220118024007.1950576-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-renesas-soc@vger.kernel.org From: Wan Jiabing [ Upstream commit 85744f2d938c5f3cfc44cb6533c157469634da93 ] Fix following coccicheck warning: ./arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c:156:1-33: Function for_each_matching_node_and_match should have of_node_put() before break and goto. Early exits from for_each_matching_node_and_match() should decrement the node reference counter. Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20211018014503.7598-1-wanjiabing@vivo.com Signed-off-by: Geert Uytterhoeven Signed-off-by: Sasha Levin --- arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c index ee949255ced3f..09ef73b99dd86 100644 --- a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c +++ b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c @@ -154,8 +154,10 @@ static int __init rcar_gen2_regulator_quirk(void) return -ENODEV; for_each_matching_node_and_match(np, rcar_gen2_quirk_match, &id) { - if (!of_device_is_available(np)) + if (!of_device_is_available(np)) { + of_node_put(np); break; + } ret = of_property_read_u32(np, "reg", &addr); if (ret) /* Skip invalid entry and continue */ @@ -164,6 +166,7 @@ static int __init rcar_gen2_regulator_quirk(void) quirk = kzalloc(sizeof(*quirk), GFP_KERNEL); if (!quirk) { ret = -ENOMEM; + of_node_put(np); goto err_mem; } -- 2.34.1 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DBCF5C433EF for ; Tue, 18 Jan 2022 03:10:14 +0000 (UTC) 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=3Zk10NXK786FIbRFdKl09c75X6hsfnrkzn5coHADVRQ=; b=piHnlveK8ZVWet D3Z1vByb7JmVghTM8IZAGshZVwXY/ynJOlix2zNdMEaj+9OMDKsiMzBihM3dpIdf1DOjAqG1It5ii i6ak4MH7wdBWJQJvVMW5WQkinCGlCWerls4IrTWINPfYhnGDyt4EChukGel4bwaOnI+1ui5hu+31T Sr/H9BK0KuFJJu96fupBQkrWmRhtVDIDfC+MuYIk1kXtxJ0/ln3Ib6jCoAfAQuuoU6LveeU7/zpZ8 9Ac7p1b8fPnPXCtFka4x7j4g619USckJ4nKJ/gdrflbGa3dgaLlOACD/GgOr3M39moWYIboHLAlwX D5Gv3fXNdYcRiupM9OtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9erU-00HJd1-6U; Tue, 18 Jan 2022 03:08:44 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n9eQZ-00H3Li-5q for linux-arm-kernel@lists.infradead.org; Tue, 18 Jan 2022 02:40:56 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BE435B81235; Tue, 18 Jan 2022 02:40:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 841E4C36AEF; Tue, 18 Jan 2022 02:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642473652; bh=k/Lz/Zo8RSedFrd/Cb57u0V3RMctMpavMVRb8b8/edc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ezn2DdYM0M9srU2XJ8dHOC5UAZ1VipoXDgDOc+Wi6uNDHIRnQGga4PEtR7Ea1zwFh O9aCOCLEo+EX21eCQR6z/T9zuE3T9Zx7Hs42ddrvcTxyZYInatFtK04OugKbDnWir4 gsbtMtIoEpwHaed6KNg8QLlqTU0TA+ufi7RqX2EZZMUh/y0pfMidVPc782cuD7H0Re VBDagUW3+etNBTpgKq9OWtjr03KhZYY64ySn3pzXJseqYM5QFyCI1t6BVFkK9pLS0d XHUBVVrLGGmoWWrvzVFgD0iCGX7l28pZpuXBY4lImceaovSElD27oFPF8jUl+qGVAV 5hpnfGjjfPh5A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wan Jiabing , Geert Uytterhoeven , Sasha Levin , magnus.damm@gmail.com, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 012/116] ARM: shmobile: rcar-gen2: Add missing of_node_put() Date: Mon, 17 Jan 2022 21:38:23 -0500 Message-Id: <20220118024007.1950576-12-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118024007.1950576-1-sashal@kernel.org> References: <20220118024007.1950576-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-20220117_184055_370697_8FE1275B X-CRM114-Status: GOOD ( 14.04 ) 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: Wan Jiabing [ Upstream commit 85744f2d938c5f3cfc44cb6533c157469634da93 ] Fix following coccicheck warning: ./arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c:156:1-33: Function for_each_matching_node_and_match should have of_node_put() before break and goto. Early exits from for_each_matching_node_and_match() should decrement the node reference counter. Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20211018014503.7598-1-wanjiabing@vivo.com Signed-off-by: Geert Uytterhoeven Signed-off-by: Sasha Levin --- arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c index ee949255ced3f..09ef73b99dd86 100644 --- a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c +++ b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c @@ -154,8 +154,10 @@ static int __init rcar_gen2_regulator_quirk(void) return -ENODEV; for_each_matching_node_and_match(np, rcar_gen2_quirk_match, &id) { - if (!of_device_is_available(np)) + if (!of_device_is_available(np)) { + of_node_put(np); break; + } ret = of_property_read_u32(np, "reg", &addr); if (ret) /* Skip invalid entry and continue */ @@ -164,6 +166,7 @@ static int __init rcar_gen2_regulator_quirk(void) quirk = kzalloc(sizeof(*quirk), GFP_KERNEL); if (!quirk) { ret = -ENOMEM; + of_node_put(np); goto err_mem; } -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel