From patchwork Sat Oct 22 07:24:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7432 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1098282wrr; Sat, 22 Oct 2022 01:10:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/Z5rB9nRf4fXphPdenzWUH3SHUm4gP9aLJmIzNv8Ohv7spCmAABp+hG1bdVou9fljV88S X-Received: by 2002:a17:902:b942:b0:178:be25:203f with SMTP id h2-20020a170902b94200b00178be25203fmr23685724pls.101.1666426218762; Sat, 22 Oct 2022 01:10:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666426218; cv=none; d=google.com; s=arc-20160816; b=Au4Xq4kqvqi0HtQfypjSKCKrPCv6LOhbyvdTKpdOXs7Do8V7OvJvx4X2pgAIsDu1aq 4yjbLhH7HzL72TCKJr+17cyE5JQWK9Rj1EChkNk3i8iR1w5OmQ9Do4xRbxZmuBa3B9In R3WDEME4Kcm31CAYkc5UETYvyOMG/vP+RqETocikUFI0VRIXNjC8b3F8BMF4c1nXrcub WHoN7ftNOrFui9o4kQN5ihGN55mMjOJBXHzqtCbGCx8dVUApu9a/x4ra9gpy0vG5b/e8 J5tiWcIwWijaRNj68zRGWIWzh0B/4LKlOd0eHAJc0bEAxJn06hzm2fxkW22P0e8b0teR ePzQ== 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=ADr1dI90+gn6K/bdUBMH3XmBpwYcvx9Y0hZnaU7Dpu6CKAF8W8sRlM/5bsCoDr+lqP 0hhw70XpUPc23nA7aqgWtg3ng5VZTto6QtkfxiSoBvKzYMSnDjNm8LenwoSPYvFj9UN0 kQHnJxGpqeNr1GTbDn3Ox2BtG42aCrZ5iP2YcATjo6mnbvXwn3/uzGfEG54fzvTuhgaU rhb3VfJUYiOkGJy2b1J1UUtE2TjiTFGlaHCG9t5aZY/xywfJhc0qW0PtWowwyGa9m/Fa Bt2RAKU/ysuIIWyot9oIDGibj+CqE6iTeAza1ejdsHsaTl7I+iJTUZ137GFTPqtQrTdf T0Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=q2cwCJ8W; 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 k3-20020a170902694300b00176a87603dbsi25012710plt.156.2022.10.22.01.10.05; Sat, 22 Oct 2022 01:10:18 -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=q2cwCJ8W; 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 S232631AbiJVIIf (ORCPT + 99 others); Sat, 22 Oct 2022 04:08:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233020AbiJVIEj (ORCPT ); Sat, 22 Oct 2022 04:04:39 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E9572EF7D; Sat, 22 Oct 2022 00:52:14 -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 ams.source.kernel.org (Postfix) with ESMTPS id 3A64FB82E07; Sat, 22 Oct 2022 07:51:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DA95C433D6; Sat, 22 Oct 2022 07:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425081; bh=YJMbba9RS1wYiGgs1JTsRQFq9wLF0YY2JGinQe5+YHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q2cwCJ8WyOsInsXa0S1svV1K0mIKRp1vE1RfuU6t/YcjzWj70SYcuxEIvtbuavZ2k 7mfwwMbMON4ZK40afIKxSkOTM38HKmlkdu1MDXd0cCttuAC3/hMVC9x05vKypEj26s TDdUXVm9qUD/+SbB8xzmzQy/9PVjzRJUU9AD9Rnw= 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 5.19 383/717] clk: oxnas: Hold reference returned by of_get_parent() Date: Sat, 22 Oct 2022 09:24:22 +0200 Message-Id: <20221022072514.451489914@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747374538610822327?= X-GMAIL-MSGID: =?utf-8?q?1747374538610822327?= 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);