From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEBDD606B735 for ; Thu, 12 Nov 2026 08:39:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=go+IUTGp; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ej68i5BY DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=ptt9szUUUD8b43DUiMKc7e08GdA5e1ZnyXeWukZgTng=; b=go+IUTGpHfbYuAeHP4/uhy4zLA nPHVwC3d+QhNnMAQ6sswQeROEZCqQ6OroeRW284r90ArQKKPjwg5o4FvHQKxAjPxTOQNLUSOo+hwT 8WQHJnBZMe9vY22yayPfVJS6e0JlNHauN1QIis2ei2THtzKk6MA7DSaGqb/Zn8UPvlEIdEOIN3HNj r26FIOdnXFDUQrnnOcD2z+13pIo+YrmF7kHa6Ur2jDz6aB6MEAjMo1b0K3Gr169EVmwp8gEM4iBSe W/e690O/jEwNGLmQaIC2qqOLyWCYpEPhVudweNKfaSzIZiiPKXAExchLSZkmIPdoe8VzC3GRsTgmj peHQjQOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xRQLP-00000009BRc-1Vmn; Thu, 12 Nov 2026 08:39:43 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xRQGk-000000099Cw-0AF5 for linux-phy@lists.infradead.org; Thu, 12 Nov 2026 08:34:54 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 55DFD65391; Thu, 12 Nov 2026 08:34:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F9131F00A08; Thu, 12 Nov 2026 08:34:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794472493; bh=Up5j8TzM0Yy5snipwPfxPFv5mWJlT3wquG3RxXthBZY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=ej68i5BY75arsjTGasmRdWC+rEebnr8+zb6tSnR1zawq3K3rjE6cC2JMg0rROTEMw TCfHAmVECuO7NZIi4gNwHXwxaDQaAFitEEeIGGhjYFteZ3vI0JhYbgJnsmraEWG45J 23o1qrSD9ZdNhujG66uaqYjANu0/DJ9+Mdw2AH9qbxz5gzxULF+4Rw1WWDYGOU69ar Apf6lEFOKNSDA1hkN/l9O1K1txJ+8hDmwjbYRksRp6lda/Sdl1VIrozOzdXu2ZSvvx 1Kkqjajsw2B94RQhG/bbOrv5i61beVMaVkylBNLoxkszLalz425mEKgB4tZ7VTtJcx IzYiZAZn1B7ug== Date: Thu, 12 Nov 2026 14:04:49 +0530 From: Vinod Koul To: Wentao Liang Cc: linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, mani@kernel.org, mchehab+huawei@kernel.org, neil.armstrong@linaro.org, stable@vger.kernel.org Subject: Re: [PATCH] phy: HiSilicon: Fix device node reference leak in hi3670_pcie_get_resources_from_pcie() Message-ID: References: <20260917134144.2153731-1-vulab@iscas.ac.cn> X-Archived-By: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260917134144.2153731-1-vulab@iscas.ac.cn> X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 17-09-26, 13:41, Wentao Liang wrote: > hi3670_pcie_get_resources_from_pcie() obtains the "pcie" child node > with of_get_child_by_name(), which takes a reference on the node, but > never releases it: both the "Didn't find pcie device" and the "Failed > to get APB regmap" error paths, as well as the success path, return > without calling of_node_put(). > > The node is only needed for the device lookup, so drop the reference > right after bus_find_device_by_of_node(). We already have 1499f3d3407f ("phy: hisilicon: hi3670: Fix OF node and device reference leaks") > > Fixes: 73075011ffff ("phy: HiSilicon: Add driver for Kirin 970 PCIe PHY") > Cc: stable@vger.kernel.org > Signed-off-by: Wentao Liang > --- > drivers/phy/hisilicon/phy-hi3670-pcie.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/phy/hisilicon/phy-hi3670-pcie.c b/drivers/phy/hisilicon/phy-hi3670-pcie.c > index 87eac058a4bc..35e634279794 100644 > --- a/drivers/phy/hisilicon/phy-hi3670-pcie.c > +++ b/drivers/phy/hisilicon/phy-hi3670-pcie.c > @@ -570,6 +570,7 @@ static int hi3670_pcie_get_resources_from_pcie(struct hi3670_pcie_phy *phy) > } > > pcie_dev = bus_find_device_by_of_node(&platform_bus_type, pcie_port); > + of_node_put(pcie_port); > if (!pcie_dev) { > dev_err(dev, "Didn't find pcie device\n"); > return -ENODEV; > -- > 2.34.1 -- ~Vinod -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794472493; b=HamZkUnIaZgKU0PviWtqebbU6bmzakDnh7tZ8iwpYkDmvuJcV/Pmr7HfGjBTtpQljcLc oSUudUcZcsmi29JgRIur2agbRNxapT7lsnN8EdwMvgtN9744rTnnREth8E8kFkL8PYpgq fq0M/HzvOZW3RhoD/KXeVBaGY3j64snUuyU9gW4BqiDg7yFuvTT+RQv8eUar+CSmn7tSg luu4HRtMJXtpwwrIP58jBcfrR2zOBCKXELKAu37skF0d6MLDvKDRk4/CnHvXtwD+TopYp o9f7OGAI+bWkaB+HWGC02lbvYOJxiUni5hLCifA3VenDkZUTh1KLYP+aJPWyYTarDAw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794472493; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=Up5j8TzM0Yy5snipwPfxPFv5mWJlT3wquG3RxXthBZY=; b=ZGM6q6kJ6Ce2n7ytX0yAQb/Z2rf9km3CS1x4dpaKJQdmwOVV4CoCOwieEOPv7lJd5Shw a2FhGduLTjCwxGoUWDOviGy/zqklQsytZu37j9+3rhuAvOWKgZx31Sx+rHINb4wILcaij P4csHFjI3+k16pCb/N/epAeMZqcIo2hwxReDRSW3AlDrNLGvgfBAEGMxqMNlY63Elg0yT MdYzA+D5w9BdWL9HE3nM6/S9298aqN0XeUo4jZL2pXQ3Y+oBkCvWZObxbuHriYdFEb2en l2MfJzDnoKI0n3C/FC/ZJQr6PyVaXYJoKuV2BbtT7iZzpPtrJ476uu5eaLLyHbqbxFw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ej68i5BY; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68CF7606B707; Thu, 12 Nov 2026 08:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ej68i5BY Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F9131F00A08; Thu, 12 Nov 2026 08:34:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794472493; bh=Up5j8TzM0Yy5snipwPfxPFv5mWJlT3wquG3RxXthBZY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=ej68i5BY75arsjTGasmRdWC+rEebnr8+zb6tSnR1zawq3K3rjE6cC2JMg0rROTEMw TCfHAmVECuO7NZIi4gNwHXwxaDQaAFitEEeIGGhjYFteZ3vI0JhYbgJnsmraEWG45J 23o1qrSD9ZdNhujG66uaqYjANu0/DJ9+Mdw2AH9qbxz5gzxULF+4Rw1WWDYGOU69ar Apf6lEFOKNSDA1hkN/l9O1K1txJ+8hDmwjbYRksRp6lda/Sdl1VIrozOzdXu2ZSvvx 1Kkqjajsw2B94RQhG/bbOrv5i61beVMaVkylBNLoxkszLalz425mEKgB4tZ7VTtJcx IzYiZAZn1B7ug== Date: Thu, 12 Nov 2026 14:04:49 +0530 From: Vinod Koul To: Wentao Liang Cc: linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, mani@kernel.org, mchehab+huawei@kernel.org, neil.armstrong@linaro.org, stable@vger.kernel.org Subject: Re: [PATCH] phy: HiSilicon: Fix device node reference leak in hi3670_pcie_get_resources_from_pcie() Message-ID: References: <20260917134144.2153731-1-vulab@iscas.ac.cn> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260917134144.2153731-1-vulab@iscas.ac.cn> On 17-09-26, 13:41, Wentao Liang wrote: > hi3670_pcie_get_resources_from_pcie() obtains the "pcie" child node > with of_get_child_by_name(), which takes a reference on the node, but > never releases it: both the "Didn't find pcie device" and the "Failed > to get APB regmap" error paths, as well as the success path, return > without calling of_node_put(). > > The node is only needed for the device lookup, so drop the reference > right after bus_find_device_by_of_node(). We already have 1499f3d3407f ("phy: hisilicon: hi3670: Fix OF node and device reference leaks") > > Fixes: 73075011ffff ("phy: HiSilicon: Add driver for Kirin 970 PCIe PHY") > Cc: stable@vger.kernel.org > Signed-off-by: Wentao Liang > --- > drivers/phy/hisilicon/phy-hi3670-pcie.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/phy/hisilicon/phy-hi3670-pcie.c b/drivers/phy/hisilicon/phy-hi3670-pcie.c > index 87eac058a4bc..35e634279794 100644 > --- a/drivers/phy/hisilicon/phy-hi3670-pcie.c > +++ b/drivers/phy/hisilicon/phy-hi3670-pcie.c > @@ -570,6 +570,7 @@ static int hi3670_pcie_get_resources_from_pcie(struct hi3670_pcie_phy *phy) > } > > pcie_dev = bus_find_device_by_of_node(&platform_bus_type, pcie_port); > + of_node_put(pcie_port); > if (!pcie_dev) { > dev_err(dev, "Didn't find pcie device\n"); > return -ENODEV; > -- > 2.34.1 -- ~Vinod