From patchwork Sat Oct 22 07:25:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1104381wrr; Sat, 22 Oct 2022 01:31:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM51eYvt8dejFz55RAwnCBKBWLTuWHEq9RYLO6klLAQ6GgAeaBYyv5iytaemndv2oy2q/g0U X-Received: by 2002:a17:90b:2643:b0:205:bd0d:bdff with SMTP id pa3-20020a17090b264300b00205bd0dbdffmr26433062pjb.99.1666427506022; Sat, 22 Oct 2022 01:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427506; cv=none; d=google.com; s=arc-20160816; b=A8ThleO1yCzTNeozn7r3Q0L0LvkTVwA8HUcXDSS/XmQkddUrbXTFGqlkxaB0fNnl/A btxlDpykccsz2UwGf/zacIzxEJlD8UBWn0CnLkyj6UFwyqTgHzIuHwZBIbuEDHrQUP1m 3jCCt4/DTe4A784KOd9gecxaGmtxmLu8MArK+7TBpop6WMmeKtN23NcUBpfZyGR6Fsfl mSSZmigvxmJ5LQNGoC/QEmI6R71UOlftBSkdN0xW4rsdHrUTmBazc1QMoBpH22IwL6g3 AGEXEkIaT1rP4B0Vzj3U7iSsd5qc6Wuy/4AEK2WlXHJlv4mYKHiTU6ng15h2hJqZobeT /t0w== 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=b+5GxKKMva9AUUqwKXre1iUt58LUAQDxqegFIE1qj5s=; b=gLEtiqRQP+UDVtjy0Wcgeg72+AtX02o2O0E/77yrqxzRNYw7WgmRoH7yT0ImcPyN1u Py1NnyvV9DjJRqeVAPlMfHzw/EOw3TdlAwe2dg7X5Gagrvx0n5UU3Rni8r+VtABtoAd+ vhMFBrW46/AU5gIvXFa7mX/P9vZauiFguM5s4W8FFAPaMVJA65lTYQjFfCHZgv2Umtdz WF6xzEFDL7XD8ODjbzKRrrVCFj5xbzaVuIdjioNviA7fzCGyr72BxvKv9hY7mk6r8hcK PipGUJe+YDGY7f8Lrlc0StPp3Pf2KGFQMvXThlTkGdQDhP+1U41Au7Cqt6PIEy0Aovo8 n3XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qzDLZY7i; 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 a11-20020a170902eccb00b00176db576dc0si33535273plh.147.2022.10.22.01.31.33; Sat, 22 Oct 2022 01:31: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=qzDLZY7i; 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 S233350AbiJVIMa (ORCPT + 99 others); Sat, 22 Oct 2022 04:12:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233036AbiJVIKX (ORCPT ); Sat, 22 Oct 2022 04:10:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6ADC33A2B; Sat, 22 Oct 2022 00:54:39 -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 4809060B90; Sat, 22 Oct 2022 07:54:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36A3BC433C1; Sat, 22 Oct 2022 07:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425255; bh=mPVjszT3wboNXS/Hfwq1BXiLQmXtBUP5WVrK5S+6wHQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qzDLZY7iXNC1M1E6l98n6mnf6/gelwi7XGeuaqqzHeD78AmxDTWCJoAsFIcraPh29 cvqRpjotvKmBc5zsaIgDm16mzWUSP+1x9z8FJUkSxycNXTRFqAWLPZinljNlVM9Cr3 xHdsTuMsFJzdUHRARM06Hwu3FQMtwjbzjonWYzr4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Vinod Koul , Sasha Levin Subject: [PATCH 5.19 424/717] phy: amlogic: phy-meson-axg-mipi-pcie-analog: Hold reference returned by of_get_parent() Date: Sat, 22 Oct 2022 09:25:03 +0200 Message-Id: <20221022072517.169860831@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?1747375888385059791?= X-GMAIL-MSGID: =?utf-8?q?1747375888385059791?= From: Liang He [ Upstream commit c4c349be07aeec5f397a349046dc5fc0f2657691 ] As the of_get_parent() will increase the refcount of the node->parent and the reference will be discarded, so we should hold the reference with which we can decrease the refcount when done. Fixes: 8eff8b4e22d9 ("phy: amlogic: phy-meson-axg-mipi-pcie-analog: add support for MIPI DSI analog") Signed-off-by: Liang He Link: https://lore.kernel.org/r/20220915093506.4009456-1-windhl@126.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c b/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c index 1027ece6ca12..a3e1108b736d 100644 --- a/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c +++ b/drivers/phy/amlogic/phy-meson-axg-mipi-pcie-analog.c @@ -197,7 +197,7 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev) struct phy_provider *phy; struct device *dev = &pdev->dev; struct phy_axg_mipi_pcie_analog_priv *priv; - struct device_node *np = dev->of_node; + struct device_node *np = dev->of_node, *parent_np; struct regmap *map; int ret; @@ -206,7 +206,9 @@ static int phy_axg_mipi_pcie_analog_probe(struct platform_device *pdev) return -ENOMEM; /* Get the hhi system controller node */ - map = syscon_node_to_regmap(of_get_parent(dev->of_node)); + parent_np = of_get_parent(dev->of_node); + map = syscon_node_to_regmap(parent_np); + of_node_put(parent_np); if (IS_ERR(map)) { dev_err(dev, "failed to get HHI regmap\n");