From patchwork Wed Oct 19 08:29:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4757 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp214715wrs; Wed, 19 Oct 2022 02:13:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5c2OaYzuQiiRGLNofOoHEI0PpMdXd4UOwU0ObM1Y3h3wD7mfSYa6xL+weeGmdgzS4yd6Pd X-Received: by 2002:aa7:c509:0:b0:458:cb1f:b9e1 with SMTP id o9-20020aa7c509000000b00458cb1fb9e1mr6417896edq.369.1666170814490; Wed, 19 Oct 2022 02:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170814; cv=none; d=google.com; s=arc-20160816; b=oHKkP2dsmIVVSjIuGonp1O89ioYi9FJDsWWI5ky5PcJ0cG8uXnEoUmxv9II37KWF6D vMaZrEzpnNnG3U6a05hDEOqCRROXOcJqFP5PxgcvGS7qUjUrogC7DbpWjUGCgPLfD6UA f/P2krLYd/53xSqqEFkokhutIX4+J3Rvkh8FCFmN/REgr6fKZ77dKKXtjE0VKxojvzhf nH9rmRHoO8xVukPI2Gv5uykwZam77KGse8m75Tjqk5BMQ27un/ZtiYtyV4wqfsx7bzue T5wqkKQb/uxwe+X1ndKosvKR2bj9iXI1F4JRfeFZi0jjsvpFbl8HCq3S2VXvQaXmPZL5 Wyyg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=67YBjDUrOaqwwQhvLBhano/hvSZAX1/tbJxeOYqhBM4=; b=YEQe+CQQegNoIEfX/cxn8g0zXOCSGNlVmmfB5kx+/xP//NmmU3M0k156JCmOXwtjx3 M8Hjo1tHPy7xZV4MahUhiUrxjst3PLULumQeAz3mFxjbwXbzOx3Y8uPdKvp9luoUcok1 +0wND9Vp8EvIn8vJIWE9FoqvLehc1RouYJ1vjv5lNoNxPSd8Ukyf40kO6on0XrxAOkbY Vru2abX/uiux9ICLgWv9SqB05C/94dg+5Sf0CfLnhenrQGKBnX3uTh3hwCu8lfUp2INV YK6wJhijMpiKOugidwLfYMfdWqsceZqAl+DiSj0RPmWEMg5TqCidon+Hucjv3GATxrTF idZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aPNOvDMf; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f14-20020a056402354e00b00457dcfa56cbsi15945674edd.343.2022.10.19.02.13.10; Wed, 19 Oct 2022 02:13:34 -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=@linuxfoundation.org header.s=korg header.b=aPNOvDMf; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232771AbiJSJLL (ORCPT + 99 others); Wed, 19 Oct 2022 05:11:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232649AbiJSJIP (ORCPT ); Wed, 19 Oct 2022 05:08:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE93C6705D; Wed, 19 Oct 2022 02:00:08 -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 D95516186B; Wed, 19 Oct 2022 08:59:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5FCCC433C1; Wed, 19 Oct 2022 08:59:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169951; bh=YJMbba9RS1wYiGgs1JTsRQFq9wLF0YY2JGinQe5+YHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aPNOvDMfhBlFzGtHQNDLmzb8rdxG1QNoFMVnMKhaEk698kmTpniTxO6YXdA/v6q+b gumrBHG1/nE3J0bwzPZVGRlEe5gdQ7YbVVEV2uodgg9+vTblFiPcKdrXgz25HrAJnF gFNEjLS0XfcSAmbXeLsTPj7ufDmA8Nwg6MsMfN2I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Stephen Boyd , Sasha Levin Subject: [PATCH 6.0 470/862] clk: oxnas: Hold reference returned by of_get_parent() Date: Wed, 19 Oct 2022 10:29:17 +0200 Message-Id: <20221019083310.736073687@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747106728329505977?= X-GMAIL-MSGID: =?utf-8?q?1747106728329505977?= From: Liang He [ Upstream commit 1d6aa08c54cd0e005210ab8e3b1e92ede70f8a4f ] In oxnas_stdclk_probe(), we need to hold the reference returned by of_get_parent() and use it to call of_node_put() for refcount balance. Fixes: 0bbd72b4c64f ("clk: Add Oxford Semiconductor OXNAS Standard Clocks") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220628143155.170550-1-windhl@126.com Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/clk-oxnas.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-oxnas.c b/drivers/clk/clk-oxnas.c index cda5e258355b..584e293156ad 100644 --- a/drivers/clk/clk-oxnas.c +++ b/drivers/clk/clk-oxnas.c @@ -207,7 +207,7 @@ static const struct of_device_id oxnas_stdclk_dt_ids[] = { static int oxnas_stdclk_probe(struct platform_device *pdev) { - struct device_node *np = pdev->dev.of_node; + struct device_node *np = pdev->dev.of_node, *parent_np; const struct oxnas_stdclk_data *data; struct regmap *regmap; int ret; @@ -215,7 +215,9 @@ static int oxnas_stdclk_probe(struct platform_device *pdev) data = of_device_get_match_data(&pdev->dev); - regmap = syscon_node_to_regmap(of_get_parent(np)); + parent_np = of_get_parent(np); + regmap = syscon_node_to_regmap(parent_np); + of_node_put(parent_np); if (IS_ERR(regmap)) { dev_err(&pdev->dev, "failed to have parent regmap\n"); return PTR_ERR(regmap);