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 72164C6FA82 for ; Thu, 15 Sep 2022 01:44:37 +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: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:In-Reply-To:References: List-Owner; bh=V6F9Gnw31feb3qARgZU099jvviK+Pp0Jq6n707GHtt0=; b=vanfb+DasqKjeQ 3sPr7T8yAH0xir8RKiCG5pjL1qR43p0Tv0PFiqNzn4G1itSMYRq6RlyPMyxjWJ4pEMahEgqlbv5Ih tC3woZ+XVL/qHe4PAR7lLHNEamJSaiXlR3y55Rw6GjV3wwdfLSNYdyrLrAilfB7re4boxIwXHiTwQ WTqW/j5qjVTZZmMEuhogJ87ZvSE2mrjP4mmant3SozQkmGT9VspR53y23vpiVsfBLHVqiourIxM0u aOAni4ykCxhL3ba/6sJExVS8J6TuLy2qHXtZQjIJw4wXShJ7TQO0e/ZLDtUFF/8zgVSMlR7LcGIyQ odb20+aco4WYkwjLTrog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYduk-00EWEg-73; Thu, 15 Sep 2022 01:43:38 +0000 Received: from mail-m965.mail.126.com ([123.126.96.5]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYdug-00EW9m-66 for linux-arm-kernel@lists.infradead.org; Thu, 15 Sep 2022 01:43:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=26gGZ Tw4OQNkXxJ3ttJM4G7oxdRW1/QI2logWeIh9Kg=; b=I9KcWGGB4aQup4YrXdBHs xqBowB94+Rnm+RhXWZqD72qUQWyBeQYmcXTF1grdd8MBBp1R2ZWFFMcv1gembVZQ ekHfklCoUWow0iIBpF7T4JKVbG7+K92T8LO3F8EUeeVDMcR0SA65Geb/4HQuwM1i Vn9n3DDJJI/l+ko2Rnzg7M= Received: from localhost.localdomain (unknown [124.16.139.61]) by smtp10 (Coremail) with SMTP id NuRpCgD3+jolgyJj993WBg--.27316S2; Thu, 15 Sep 2022 09:43:03 +0800 (CST) From: Liang He To: tony@atomide.com, linux@armlinux.org.uk, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: windhl@126.com, chenmengda2009@163.com Subject: [PATCH] ARM: OMAP2+: Hold reference returned from of_find_xxx API Date: Thu, 15 Sep 2022 09:42:58 +0800 Message-Id: <20220915014258.3999504-1-windhl@126.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CM-TRANSID: NuRpCgD3+jolgyJj993WBg--.27316S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrurykJFy5tF4xAw1rCFyrCrg_yoWkZwc_A3 Z2gws3Xr1FyF40gw1DCr45ursYkws5Cr47Wa4IqrW5Ka1aqw43XFsFvr9rJrW5ua17GrW3 AFn7ur4rA34DGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRWWl97UUUUU== X-Originating-IP: [124.16.139.61] X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbi2gd9F1uwMvZ1YAAAsN X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220914_184334_595052_E292714C X-CRM114-Status: UNSURE ( 9.91 ) 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 In omap4_twl_init(), we should hold the reference returned from of_find_compatible_node() which has increased the refcount and then call of_node_put() with it when done. Fixes: ccd369455a23 ("ARM: OMAP2+: Remove bogus warnings for machines without twl PMIC") Signed-off-by: Liang He Signed-off-by: Mengda Chen --- arch/arm/mach-omap2/omap_twl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/omap_twl.c b/arch/arm/mach-omap2/omap_twl.c index d4dab041324d..07b5f17066ce 100644 --- a/arch/arm/mach-omap2/omap_twl.c +++ b/arch/arm/mach-omap2/omap_twl.c @@ -213,11 +213,13 @@ static struct omap_voltdm_pmic omap4_core_pmic = { int __init omap4_twl_init(void) { struct voltagedomain *voltdm; + struct device_node *np; if (!cpu_is_omap44xx() || - of_find_compatible_node(NULL, NULL, "motorola,cpcap")) + (np = of_find_compatible_node(NULL, NULL, "motorola,cpcap"))) { + of_node_put(np); return -ENODEV; - + } voltdm = voltdm_lookup("mpu"); omap_voltage_register_pmic(voltdm, &omap4_mpu_pmic); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel