Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7400566rwi; Mon, 24 Oct 2022 14:10:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BgcjZJlAxBJaZ4zVw0ktE6n476AwGaa1DyawD3p4lzvIXMx3l8S1ncV+OmoXoYLR71v60 X-Received: by 2002:a17:906:cc5b:b0:7a9:e58d:bad9 with SMTP id mm27-20020a170906cc5b00b007a9e58dbad9mr4250423ejb.237.1666645852641; Mon, 24 Oct 2022 14:10:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666645852; cv=none; d=google.com; s=arc-20160816; b=PdGcWHrwbirjdM0hkDh6koKsg9giz2cvLl9Y+bAjd4qERfV1UUYKgCTlMxgkthdvsM lsCOvJExki5nP4HZlaFQy7X5xwtkzI8LvX6qtOHfNcTD5AFttiDaUBYbYLf+HOju68+U zyo4p+StE0LnLGgWimu+T1T90sVfGjeKzVW1UMwUnWB9ED/XVLk1Xcw1Ksc33rJsrlir 3q4kjHeNcZYtwYiKR6q6b2J0W//SYxOYiS6+3ODbnmGc28l4UIU9vcaIT5ahl0YS4s7T il4DseiqYf3EvZ6njISrQ+tTfl0Aks/ZrbpgxjHYHfn2vH7V4PZvvNLSE17H1+MxLI3y bFDQ== 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=Un1p+oinXTHB+mEc0I3By659HXmT1ImoFk91PX0VvPMBLWbBvcolh/h1VEnvGbnHmY 5p1TA2+YLseyKDWI67SmD0t3l/v4r1RTFDdzes6Ub8avEKd7arAmO8dMG11KQrt/Y3gM j0v2/kOg+Z77GmFuoNiEnCs6o7G921+JPDqHl9ndUSnOff7+Qg+oCSjAMcg5781wpphz kaWCZt8SNfQlhpznYkF+qqze7wmscH3PHRrNpA//PTQ2aWsKXNrMHmzO0BMGtpCt+E1F peEcMFt5/IjcbjPlatHPjoVkqaBE9V/2aaZbBT78GUCH9vZ+MLY0rO6GbYBy7IlVBnv8 p/Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FW2icNry; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id tl25-20020a170907c31900b007309eb6dcbfsi716496ejc.372.2022.10.24.14.10.26; Mon, 24 Oct 2022 14:10:52 -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=FW2icNry; 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 S235161AbiJXUwf (ORCPT + 99 others); Mon, 24 Oct 2022 16:52:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235158AbiJXUv7 (ORCPT ); Mon, 24 Oct 2022 16:51:59 -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 30E806D84C; Mon, 24 Oct 2022 11:58:45 -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 D8F7D6125A; Mon, 24 Oct 2022 12:01:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0537C433D6; Mon, 24 Oct 2022 12:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612875; bh=JQ1YhggFy28azsY8urVLO5ERLFM3p0+gWjXW8vwNE0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FW2icNrybvPuk32RgZfs9DiGAGy4skpoIxkyGC94whg/EGAImrtFycTUH9KrU7BZE r9Gggxubsjiq2gNBOGUb6ik38qa2sPjeqmNhSoK+623TMFe2+epkYuipET2ppApaw4 EREr3onGw71vGhFirub+oWtIkWBa+rqXhi1gTESA= 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.19 121/229] clk: oxnas: Hold reference returned by of_get_parent() Date: Mon, 24 Oct 2022 13:30:40 +0200 Message-Id: <20221024113002.910201690@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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); -- 2.35.1