From patchwork Mon Oct 24 11:30:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8590 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp419257wru; Mon, 24 Oct 2022 05:15:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7o4EQONuGRqnukAjhOuho6sKeRBsYJGtNBz+TTUGEKKJoMA3gT2rxB+YZknrdO5qaeS3ch X-Received: by 2002:a17:906:58cc:b0:78d:ce9c:3787 with SMTP id e12-20020a17090658cc00b0078dce9c3787mr27006909ejs.715.1666613746997; Mon, 24 Oct 2022 05:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613746; cv=none; d=google.com; s=arc-20160816; b=v1SFpY2R0eROBXdkgpyW1ItDi/sErcubDXXFTQEAv+lQkqMDO0InGRGk/k+TtQVqPE lol19wdRD6eY00HMfdV93LqKESxYNVvg2UjL/GbDUgOY8GD5+c0d0A542J2ruNzeq2aq FQVMu8V5/2vWxuj9rN9GdNUIKR64tUeIggEEpJWv64Av4eD1Zb2dEYbDIJ8KtxtG8nX3 fcez/1J+v7yFMW2158c2SKfqWtb7xGHdmWuygxQ9Jhf4bxHIE5K84DTbq9IjLax17HjY ZdN1yq4w5o8ZTpYlLMqt0+Jf9yBeBgTd4CnzbIwmgy7+dNYddGiZNOw6D8iMm06tUy4e RtUg== 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=HMAPptS1OVr021ziaCM9TJZAbL1YlJYFQPeaByQn3g8=; b=j3SzlUX4Yg4HFPMkc85SxdWJqt7QfUzm/8VGfUD53Qhl9xKBTUyaGvfDfnTO/Cnb1f INxXeaouAJSGEZ84uhj+RnwMJjRP+X7zPQ8mjPRVkcmznYRHEcT9egmLX/ifJsH++4xI 9ZIGRNMPWC7LIbHLhu9qVTynBDvz2yCL4kjK88w3RP0fcH0ROAGAhBNyPoLBKi64DQhI HhrPrIrpzE4QSuUHCje7Qohm/OwQlZP2BjGtJjbhhtZc0JAQcF2bbfsA1aNUemPo9Vht wmEgvCqNXx+zQz9U0cv9uGZBNg+u3hsEn8TeDzf41dvpxARgBmS41gNmAq8kZ4lifMIY X5qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Nud6iqjI; 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 hz4-20020a1709072ce400b0079a9eed8c1bsi8601415ejc.894.2022.10.24.05.15.22; Mon, 24 Oct 2022 05:15:46 -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=Nud6iqjI; 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 S232689AbiJXMGm (ORCPT + 99 others); Mon, 24 Oct 2022 08:06:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232885AbiJXMEg (ORCPT ); Mon, 24 Oct 2022 08:04:36 -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 91BAB6D9E5; Mon, 24 Oct 2022 04:50:42 -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 64347612D5; Mon, 24 Oct 2022 11:50:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7728AC4314C; Mon, 24 Oct 2022 11:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612223; bh=JQ1YhggFy28azsY8urVLO5ERLFM3p0+gWjXW8vwNE0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nud6iqjIFxS5v5og4PCz5tWFzu3l+kQZhSnG3RDnsmDbOdRdnbn22BclNaozXEDLW 2X0I2JaJpJjju6pMJQ5rtC9RapxEuPaPcT6QN4h3y3+ItORoSdJ/MSSVnW3lgReOBf INDnwFYaCgrog5ivLElro7BGxcMOoBCtC2FY9hck= 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 4.14 117/210] clk: oxnas: Hold reference returned by of_get_parent() Date: Mon, 24 Oct 2022 13:30:34 +0200 Message-Id: <20221024113000.785793272@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747571176112773517?= X-GMAIL-MSGID: =?utf-8?q?1747571176112773517?= 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 e51e0023fc6e..a92bf71f03ac 100644 --- a/drivers/clk/clk-oxnas.c +++ b/drivers/clk/clk-oxnas.c @@ -218,7 +218,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; const struct of_device_id *id; struct regmap *regmap; @@ -230,7 +230,9 @@ static int oxnas_stdclk_probe(struct platform_device *pdev) return -ENODEV; data = id->data; - 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);