From patchwork Mon Oct 24 11:30:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10008 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp617512wru; Mon, 24 Oct 2022 12:31:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7+QX1NXrpcXNsUKl7imMMsPBU+2DJBN5FFu/HV1szrynfNH1K1mAyRDsnz19wWrCQPWMLa X-Received: by 2002:a17:902:ec81:b0:185:3cea:6326 with SMTP id x1-20020a170902ec8100b001853cea6326mr35106938plg.24.1666639896603; Mon, 24 Oct 2022 12:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666639896; cv=none; d=google.com; s=arc-20160816; b=Zbf/KwG1aXPc6KByaZlFulnamD7uNCx+ySNEGZ47869K17EOU2B4WW4o3Pk9flVV/Q Zn9X0qUGJ2bzLtIHgVyZcUW42vnLQjr0JbbPyn6SRvR1UjkI7Lpj5+oekAHnlz+6UFmF WFE9st2LZidjnp3sl7EHHOZI1HTpIKRh6+Mhxy/BIk9F0IdkrtfhFFevbbxYsnKsZXr/ i1aiiftcwyXuolRA1L3fdKn0wGBcUA4qHn71o90YlotcE4rv81t6U33Jede58ZJVohqO uiE7Uz1ymth4b73AqnmMdHsxM6kCe3l48t4W939PKl1LRGnceQaQ5hxV/R5lAGmJVsoe U/DQ== 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=QnwoUgZ5ciF8u9OLXCbaVZ5i4fkFfcoj34rUa/fH3iC0DoaIVuBBEavQJtA8Sav5Tn pWIrCMSG3sw8nnPNvmfioFxw3oLpEf4V7b5il1S1aUaymL8sc4v/bvN1L6NFR289Ov1t PHfekrh5a54BRd7jPaCzi5GY3RrCF2pcg4lMu7bzSWAbi0Yi3iNzKnl1jDMIPNKBmMDV OYYSTEKa4itFN6Jzf9or39VTR3fWRqto8JordAXt4f1uESx70XOunbVl/gVLxPiM426U GbIOmorrrTKM76UC7NJYO4846VF/BUXiv6T66bYhB4soOnOHsu6DfWuTm/GO+V6aC+n5 FhkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="h2Rdn/9E"; 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 bg7-20020a17090b0d8700b0020579d99c4dsi842270pjb.138.2022.10.24.12.31.22; Mon, 24 Oct 2022 12:31:36 -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="h2Rdn/9E"; 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 S231946AbiJXTau (ORCPT + 99 others); Mon, 24 Oct 2022 15:30:50 -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 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?1747598596350176308?= X-GMAIL-MSGID: =?utf-8?q?1747598596350176308?= 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");