From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED6941B424F; Sun, 7 Sep 2025 20:12:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757275965; cv=none; b=ZtX5Y96tsP9OESf+DYC+a+klpw90G5+muvXrRPSH0iHA5aT9C1dcrZMiIZ6fuPxjUywWdl1KTHkUJ5LwazUTtMYrax+Ai3rF7xEvltvXmpVA6XPkeXNmJZaXz7lenqwCip3yti09ltsdLFAicO+6cmkdu324ZHApKiO0fPzz94I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757275965; c=relaxed/simple; bh=WkDrk8G1jZmlm/iDYSUdASlXoDIwvVWj3IE9wcQ70Uk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PuHu2KZhHbFZHFXE0KK2P3uwWnfkIEp+nQQBbyWSU07TwBoRZYwEK8KH6XTvNGtuSMdDP21fEVF3zejEIqi6JGZXHb7DsT4aSIRTCeKr1XqhAIpuBXjwQ5C+TOxggiT6O/e5YbLx6/wbob9fqmj89n9976CYXdPYuZ8pCMXQAr8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jkKnr4iP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jkKnr4iP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71ABBC4CEF0; Sun, 7 Sep 2025 20:12:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1757275964; bh=WkDrk8G1jZmlm/iDYSUdASlXoDIwvVWj3IE9wcQ70Uk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jkKnr4iPoOnLgcgApbqH50JRoRoWec/Cl3HSM2YaOiXZ10U6ZIdo46WC6SD5Ox5El YvwhWwdCZgEHn3OcaJWe3vpXOwYrpvZnrVpE6g5Se9boZysFa4L/ZQ0Au3h7lhzqAi wk0eqmogO0+pytsAD7m+RhSGw5lnkmqsD/BoNgkc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Rosen Penev , Simon Horman , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 20/64] net: thunder_bgx: add a missing of_node_put Date: Sun, 7 Sep 2025 21:58:02 +0200 Message-ID: <20250907195603.952550170@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250907195603.394640159@linuxfoundation.org> References: <20250907195603.394640159@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rosen Penev [ Upstream commit 9d28f94912589f04ab51fbccaef287d4f40e0d1f ] phy_np needs to get freed, just like the other child nodes. Fixes: 5fc7cf179449 ("net: thunderx: Cleanup PHY probing code.") Signed-off-by: Rosen Penev Reviewed-by: Simon Horman Link: https://patch.msgid.link/20250901213018.47392-1-rosenp@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- .../net/ethernet/cavium/thunder/thunder_bgx.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c index 1831066c76475..d749431803e2e 100644 --- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c +++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c @@ -1491,13 +1491,17 @@ static int bgx_init_of_phy(struct bgx *bgx) * this cortina phy, for which there is no driver * support, ignore it. */ - if (phy_np && - !of_device_is_compatible(phy_np, "cortina,cs4223-slice")) { - /* Wait until the phy drivers are available */ - pd = of_phy_find_device(phy_np); - if (!pd) - goto defer; - bgx->lmac[lmac].phydev = pd; + if (phy_np) { + if (!of_device_is_compatible(phy_np, "cortina,cs4223-slice")) { + /* Wait until the phy drivers are available */ + pd = of_phy_find_device(phy_np); + if (!pd) { + of_node_put(phy_np); + goto defer; + } + bgx->lmac[lmac].phydev = pd; + } + of_node_put(phy_np); } lmac++; -- 2.50.1