Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1973652iog; Thu, 16 Jun 2022 19:01:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sD1I+Gn6PwEWgnpmsnqEfd6BgXJl71Y0d3hY8+uVfk5+m449X5KxQPahu6zWyLWgXDT7+E X-Received: by 2002:a05:6402:428a:b0:42e:8f7e:1638 with SMTP id g10-20020a056402428a00b0042e8f7e1638mr9624068edc.228.1655431309548; Thu, 16 Jun 2022 19:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655431309; cv=none; d=google.com; s=arc-20160816; b=E8pUBwaP4m6gidSIIHaFtJsMdhHPlokqiGi+EfigeuQSRDKjlxjtKWvFLD7toTazit J0MHOmusQ0S5wQ4yAwYhXiyPqGxgjDMWnxkxcMzmIB6Go7w84b0cEKcpAbocFEc+z8FV R3vPTctqw0XxCDEZIs81qHLdno3YpN87yi8l9s+MKh1lJJuh+D0GlJVbI+bpFjnl8yUe SZVpxIm1RLSHPQ8grfBI0q8qHMmyeg83civPHFvospom68fZ8Qf15VBUhjGl/LLJ6Met 7qFfCtjibxWA4WfVysktakVSbqaOhg09882diprnRRR2qmMNwm1sy+RNGw06alrthLaF M3zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=DI+WCbTryVSUwE4AJeh6OWVzHOzOvSO0HxklZbRyl3k=; b=lh/4ItaD+Ike48bCU1incMp6EbfWvMjNLTrTKSRVI4wPKNkhrzag5ZbDNE5uumuMEN 4ISYNmHEAG8o/NGbB2fcU/qm7wManz2m5aYkI+H+K+49AXuPPo9XXXZliXllw5wSFyl3 /WQatkU8MzeXjTJGccg81fHW/dpl4E4vMOVO+1rsCuEGiecQJ+HC9QGPIKUwamcSQunT z67usNek8qvgWGJwou3HP2HRNV9LDfy1qmd00nPqOtB85/bh2dmyv87ik8OrsTrmiMdW T6F9EtaSgdSWV00FChdcusrg6XBDfAx6DZskSN4cH+WKJvt70wJKt1rHPK2K/kKNE/+u Vhow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=dva0AQ1I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z3-20020a056402274300b0043343af5d52si510450edd.409.2022.06.16.19.01.20; Thu, 16 Jun 2022 19:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=dva0AQ1I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233338AbiFQBpU (ORCPT + 99 others); Thu, 16 Jun 2022 21:45:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379789AbiFQBnh (ORCPT ); Thu, 16 Jun 2022 21:43:37 -0400 Received: from mail-m964.mail.126.com (mail-m964.mail.126.com [123.126.96.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 88D1926541; Thu, 16 Jun 2022 18:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=DI+WC bTryVSUwE4AJeh6OWVzHOzOvSO0HxklZbRyl3k=; b=dva0AQ1IFaf7I2q4kud7S wZutFVLuDWFe+CChYT+e4kN5FGaxFNlNXk7LMp7pkiE7/A8JHAvE/nyfftt3KKcA j1OVb8lBo9icRYznJ7UoK7HXDnKGAqlJyRsHHuFzeRv43rh/o0ob5TE4lzjnqxHR 76j5YTWffQmgw6pxY9TYwM= Received: from localhost.localdomain (unknown [124.16.139.61]) by smtp9 (Coremail) with SMTP id NeRpCgBHTpot3Ktio_HDEw--.8636S2; Fri, 17 Jun 2022 09:43:10 +0800 (CST) From: Liang He To: linus.walleij@linaro.org, mturquette@baylibre.com, sboyd@kernel.org Cc: windhl@126.com, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4] clk: nomadik: Add missing of_node_put() Date: Fri, 17 Jun 2022 09:43:08 +0800 Message-Id: <20220617014308.4001511-1-windhl@126.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: NeRpCgBHTpot3Ktio_HDEw--.8636S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7JFyUCr15GrW3ZryDJF17trb_yoWkAFb_WF 4rWrnrCFW2kF4kur4jvF13u39I9r1rur4xX3Wxt3W3J342vF1DGFsFvFs3uw1UWrW2gry7 ZFsrKr4jyrWj9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRibyZUUUUUU== X-Originating-IP: [124.16.139.61] X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbizg4jF18RPTzJKAAAsa X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In nomadik_src_init(), of_find_matching_node() 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 --- changelog: v4: split v3 into nmadik and tegra v3: merge clk 'missing of_node_put()' patches into one commit. v2: use Liang He as real name for S-o-b. v1: fix the missing of_node_put(). drivers/clk/clk-nomadik.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c index bad2677e11ae..71fbe687fa7b 100644 --- a/drivers/clk/clk-nomadik.c +++ b/drivers/clk/clk-nomadik.c @@ -99,7 +99,7 @@ static void __init nomadik_src_init(void) if (!src_base) { pr_err("%s: must have src parent node with REGS (%pOFn)\n", __func__, np); - return; + goto out_put; } /* Set all timers to use the 2.4 MHz TIMCLK */ @@ -132,6 +132,9 @@ static void __init nomadik_src_init(void) } writel(val, src_base + SRC_XTALCR); register_reboot_notifier(&nomadik_clk_reboot_notifier); + +out_put: + of_node_put(np); } /** -- 2.25.1