From nobody Fri Dec 19 18:41:32 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC989C67871 for ; Mon, 24 Oct 2022 19:30:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231949AbiJXTav (ORCPT ); Mon, 24 Oct 2022 15:30:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233777AbiJXT37 (ORCPT ); Mon, 24 Oct 2022 15:29:59 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 498FA1DDC1A; Mon, 24 Oct 2022 11:01:21 -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 sin.source.kernel.org (Postfix) with ESMTPS id 1DE15CE16BF; Mon, 24 Oct 2022 12:46:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 327C9C433C1; Mon, 24 Oct 2022 12:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615573; bh=mPVjszT3wboNXS/Hfwq1BXiLQmXtBUP5WVrK5S+6wHQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h2Rdn/9E1sA87P3VyWs79wIGXbLsL/+zbUAEFNDNaecVvWnwcV+fPFiJSUWNqbp+/ RhSIc/cB9kaUtqLHBITB6d4GX/vntdNya15Jt8osU60oXyBvIksHctVbnv7CBoJVi7 MxNDUMzzGOGnfbXKTZZ/K97v8Z5Lbyl1uSdQMXpI= 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.15 303/530] phy: amlogic: phy-meson-axg-mipi-pcie-analog: Hold reference returned by of_get_parent() Date: Mon, 24 Oct 2022 13:30:47 +0200 Message-Id: <20221024113058.780786005@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 sup= port 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 platfo= rm_device *pdev) struct phy_provider *phy; struct device *dev =3D &pdev->dev; struct phy_axg_mipi_pcie_analog_priv *priv; - struct device_node *np =3D dev->of_node; + struct device_node *np =3D dev->of_node, *parent_np; struct regmap *map; int ret; =20 @@ -206,7 +206,9 @@ static int phy_axg_mipi_pcie_analog_probe(struct platfo= rm_device *pdev) return -ENOMEM; =20 /* Get the hhi system controller node */ - map =3D syscon_node_to_regmap(of_get_parent(dev->of_node)); + parent_np =3D of_get_parent(dev->of_node); + map =3D syscon_node_to_regmap(parent_np); + of_node_put(parent_np); if (IS_ERR(map)) { dev_err(dev, "failed to get HHI regmap\n"); --=20 2.35.1