From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 DEB91391842; Thu, 17 Sep 2026 15:45:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789659941; cv=none; b=J2S/a2mTtkyvLuF7YhqLv2RPaag691MgFuyTeFMjcIN81eug9IgQiTLD2sf4YWwNkdyDukxtZ+++SQtzxUf4cO8dHvzHEUDl24jANosbgbPi0eUBpk5pWvlNnVftuFNJNWc6/WK0/qlGeZJs9BEJwsf9EqqFX+FBbAniSaxnT2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789659941; c=relaxed/simple; bh=gBRBT5FmaK099JhBkQ6B7HT2TB9Tgge1B7TaAREyh3M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dJz9W9ERApfMso6u2cMS9ci0BCvvkJxUKqq7SEUZA5pUQ8H9U7arErnHTUsc0h8wMEXODDUGUiX+545EB4VcrSeGQWR5HbS+DQJj4c7daieDMkjBzTJ0/jFyRRT9OcDDZF0CcfWCUvH7NuENEDuqGtVFcs6dK2mSL+iZJLW4YPs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AGQW7r5+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AGQW7r5+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 495451F000FF; Thu, 17 Sep 2026 15:45:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789659934; bh=U/0nTgCD7jtODqZCP5INiCQuu9+eMGu81e8hq9UFxj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AGQW7r5+4khz7mF/zdqWDz1jbBNOtUZpuYHQA/+mvvjRYiORqiOEx3BQvX3iVR24f KOsLvdKLR08PmOXQ7Bo90nsmKbXJiAfqQU9z9YNTyH/XeKyRxyyCbsqCdiHfMn7mYH rYha0hrj+GQZon/nGPCV5pgDu+fkWP30L4SBApn8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Li Youhong , Simon Horman , Paolo Abeni , Sasha Levin Subject: [PATCH 7.2 424/733] net: sun4i-emac: fix missing of_node_put() for phy_node Date: Thu, 17 Sep 2026 16:12:12 +0100 Message-ID: <20260917151402.383359034@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151350.597953846@linuxfoundation.org> References: <20260917151350.597953846@linuxfoundation.org> User-Agent: quilt/0.69 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 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Li Youhong [ Upstream commit af406abfecad2f48d8f1fc646d3994f0982bac62 ] of_parse_phandle() returns a node pointer with an elevated refcount. Add the missing of_node_put() on the probe error path after register_netdev() fails and in emac_remove(). Fixes: 492205050d77 ("net: Add EMAC ethernet driver found on Allwinner A10 SoC's") Signed-off-by: Li Youhong Reviewed-by: Simon Horman Link: https://patch.msgid.link/20260904080758.2432748-1-dayou5941@163.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/allwinner/sun4i-emac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c index a297874f4a819..9382b4b329bdf 100644 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c @@ -1067,6 +1067,7 @@ static int emac_probe(struct platform_device *pdev) return 0; out_release_sram: + of_node_put(db->phy_node); sunxi_sram_release(&pdev->dev); out_clk_disable_unprepare: clk_disable_unprepare(db->clk); @@ -1094,6 +1095,7 @@ static void emac_remove(struct platform_device *pdev) } unregister_netdev(ndev); + of_node_put(db->phy_node); sunxi_sram_release(&pdev->dev); clk_disable_unprepare(db->clk); irq_dispose_mapping(ndev->irq); -- 2.53.0