mirror of
https://github.com/torvalds/linux.git
synced 2026-09-11 20:13:02 +02:00
net: sun4i-emac: fix missing of_node_put() for phy_node
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: 492205050d ("net: Add EMAC ethernet driver found on Allwinner A10 SoC's")
Signed-off-by: Li Youhong <liyouhong@kylinos.cn>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260904080758.2432748-1-dayou5941@163.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
dff39930ad
commit
af406abfec
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user