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 7FE72C43334 for ; Wed, 20 Jul 2022 01:10:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239464AbiGTBKp (ORCPT ); Tue, 19 Jul 2022 21:10:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235846AbiGTBKh (ORCPT ); Tue, 19 Jul 2022 21:10:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB01648C89; Tue, 19 Jul 2022 18:10:36 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 565936171C; Wed, 20 Jul 2022 01:10:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E48E2C341CE; Wed, 20 Jul 2022 01:10:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658279435; bh=ZtW/0VVuXnVd4D9WDVweixR/stTys6Z95/e5OU0s8nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jKCRnq4spc0PEbMkmSCLUNuOREoa5gsOqLj/WILipOU0JPKxz1XnRyEr+8a/UAz11 ZYVYmgmJTTb3qMWQc9wjjgKBgpX8kaOInkTUpAKg6b2l+5KPZaefF8V7xBjjb4IOPZ nfrfryfKzkBduy0G9t5mQwF03YczsBeIc0dE+Zdz4a1QB7S7umBeZNFOabnwn6x05h 88mbnq8LKXjPracQ26q9pYhRUe1FRr4sXj5sxRTwqEmq29uvrYUJsAIdgl8bXVN3z+ DuMfQ4rQ7lqLpcYUvHQCq2F1QQuAsDtefTUbx2yIsZ9vV0FPBioserYesjPpRyN0U/ 65XEDT1nYJ9Iw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Liang He , Heiko Stuebner , Sasha Levin , linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH AUTOSEL 5.18 02/54] ARM: rockchip: Add missing of_node_put() in rockchip_suspend_init() Date: Tue, 19 Jul 2022 21:09:39 -0400 Message-Id: <20220720011031.1023305-2-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220720011031.1023305-1-sashal@kernel.org> References: <20220720011031.1023305-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: Liang He [ Upstream commit f4470dbfb5ff92804650bc71d115c3f150d430f6 ] In rockchip_suspend_init(), of_find_matching_node_and_match() will return a node pointer with refcount incremented. We should use of_node_put() in fail path or when it is not used anymore. Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220616021713.3973472-1-windhl@126.com Signed-off-by: Heiko Stuebner Signed-off-by: Sasha Levin --- arch/arm/mach-rockchip/pm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c index 87389d9456b9..30d781d80fe0 100644 --- a/arch/arm/mach-rockchip/pm.c +++ b/arch/arm/mach-rockchip/pm.c @@ -311,7 +311,7 @@ void __init rockchip_suspend_init(void) &match); if (!match) { pr_err("Failed to find PMU node\n"); - return; + goto out_put; } pm_data = (struct rockchip_pm_data *) match->data; @@ -320,9 +320,12 @@ void __init rockchip_suspend_init(void) if (ret) { pr_err("%s: matches init error %d\n", __func__, ret); - return; + goto out_put; } } suspend_set_ops(pm_data->ops); + +out_put: + of_node_put(np); } -- 2.35.1