Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3884849rwi; Sat, 22 Oct 2022 01:32:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5wo3oHJ2q9g6phOdiZivoLJE00EOUE/Xd41cItHT5HXuctO12TCHW/J51ZRVHsIL0U0122 X-Received: by 2002:a17:902:f68d:b0:185:43a1:555a with SMTP id l13-20020a170902f68d00b0018543a1555amr22820222plg.2.1666427531205; Sat, 22 Oct 2022 01:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427531; cv=none; d=google.com; s=arc-20160816; b=D6UALXjL3GCGhudP3DOnd/ObYA1q+CLAvEw2baDMlFzYEpEvdUPDQw793ZWA+2pDhC /uEPNun9B1WPbIphKuQAdjiTIKlEX8iOW1i+TKkMEzkTNih+ALMNJkdXvL1crDZljzLf FKwWLhRlqXV1rnp3dAFDwdQUwjdpbI3zkwOI1CRGWIH7xyiia0F37YXjyxbUzZzkNrR7 KPyyzhrHBhD6Tozedo3bQTVRqRMh+FisPpWBhQBdF7UQkPAJ8azhcAKqEcSyBHYl3jYQ Plr/FMv2/xyu1gpmmz9LZ+PIWRKCKSp654NcaeSRX59wiQP0NNI3RQDT66Yg0qkUshw/ jW7Q== 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 Return-Path: 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.58; Sat, 22 Oct 2022 01:32:11 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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"); -- 2.35.1