From patchwork Mon Oct 24 11:29:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9159 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp457773wru; Mon, 24 Oct 2022 06:36:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5M0ILxoE+XvXARnKJ94pbgOPtIOEezbTp41zcouYRH124HLJ2s01HAbnRMIPzbJHBx+ofz X-Received: by 2002:a17:90b:4f46:b0:20d:1fe8:dcd2 with SMTP id pj6-20020a17090b4f4600b0020d1fe8dcd2mr73953731pjb.235.1666618589919; Mon, 24 Oct 2022 06:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618589; cv=none; d=google.com; s=arc-20160816; b=InGMiDc9BK+JwO0bABeVs3uqbkPfasUpENYZGvVzKC0Je+fgrci8VEwEKBu+CGmiVu 3O+kj1fLJxL69tmpcr4nE+4G+Kw4VkxBLaOscLLrwwa7/re1BLm4IFl4A9yoiY80D9qp e6BlGd6KdoMyZ0UhdO8Q72Jj0MjST8tU0gtZKmF5E3IlVVTsoG1JAv/oT5o48idQznpo x73KyO99NLd6wVukaLdlX23vod/ZbQUQOO61+pc/3LYNU1FW0WRZjUVaJnJY26j36sVj 8O4UD9QTZ13bG1yRfSkp1F23ixVq1M6JKpIMzzyQpWALFfuF+BMDDRjqIaWo/6ohBU2I LZag== 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=P7he3boLJjoDyg4JyksFE1FjKdheQ/OWPJaEtn3/zDQ=; b=wDaz6IqlcKGtPc9ACfv3Ro4PG5fC+d2E1e0ny4Snpbng06wg8Vlrceo/FacfMSofcM jmCe7zsXOYQygTBXDe+/zMiUbmlD62jrs6bLOAXWGQKwuQOzuBsLA5SX1DDcboGISyTB 60/v43/8NgFsGAT/Rg0UPUsbPX+qZI+LDfHTiVbGSou7q12JNb1FcV2uDmloJdI1Jnvr pAsjDgvdBq5/pcCiWCDtof4FbkFGquufcza8p8QwHs8IA2RRZg2h+bJ/zzsJC+sK6TmO NTs0wWK/HIwI+mr+O2LyhTB9koUvw5PdLflIj5WEHmqAOPuf9zl2Aioqzz17XpI++7sN 3lQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Dk/yO7XN"; 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 n1-20020a170902e54100b001786a4a4c98si37301199plf.371.2022.10.24.06.36.15; Mon, 24 Oct 2022 06:36:29 -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="Dk/yO7XN"; 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 S235847AbiJXNP7 (ORCPT + 99 others); Mon, 24 Oct 2022 09:15:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235971AbiJXNOP (ORCPT ); Mon, 24 Oct 2022 09:14:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1C474DF0C; Mon, 24 Oct 2022 05:25:16 -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 3507A612A3; Mon, 24 Oct 2022 12:24:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 485A4C433B5; Mon, 24 Oct 2022 12:24:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614268; bh=X38VWH2et6l8j7ErF92H2f0hZx1DchmzPhdw98JHFCs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dk/yO7XNLdXdk3Q6+gn0IYdQcVtPKKocsAgjD+ZbiIVapUztDSsDEFhSrkzj92dBD u2A12sHrZw9zNURwb19ht1BEYkrerspdOm9UU6ImPvt0hKxd5eEcAs5ZPOwKhpRsnv sN00X6kGOhGnsEUPTv8Fk50ckrxDGDs+lU+vO73Q= 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.10 197/390] clk: oxnas: Hold reference returned by of_get_parent() Date: Mon, 24 Oct 2022 13:29:54 +0200 Message-Id: <20221024113031.181032661@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747576254710136770?= X-GMAIL-MSGID: =?utf-8?q?1747576254710136770?= 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 78d5ea669fea..2fe36f579ac5 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; const struct of_device_id *id; struct regmap *regmap; @@ -219,7 +219,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);