Commit 7782ab22 authored by Julia Lawall's avatar Julia Lawall Committed by Greg Kroah-Hartman

stmmac: add missing of_node_put


[ Upstream commit a249708b ]

The function stmmac_dt_phy provides several possibilities for initializing
plat->mdio_node, all of which have the effect of increasing the reference
count of the assigned value.  This field is not updated elsewhere, so the
value is live until the end of the lifetime of plat (devm_allocated), just
after the end of stmmac_remove_config_dt.  Thus, add an of_node_put on
plat->mdio_node in stmmac_remove_config_dt.  It is possible that the field
mdio_node is never initialized, but of_node_put is NULL-safe, so it is also
safe to call of_node_put in that case.
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Acked-by: default avatarAlexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ee4494c6
...@@ -346,6 +346,7 @@ void stmmac_remove_config_dt(struct platform_device *pdev, ...@@ -346,6 +346,7 @@ void stmmac_remove_config_dt(struct platform_device *pdev,
if (of_phy_is_fixed_link(np)) if (of_phy_is_fixed_link(np))
of_phy_deregister_fixed_link(np); of_phy_deregister_fixed_link(np);
of_node_put(plat->phy_node); of_node_put(plat->phy_node);
of_node_put(plat->mdio_node);
} }
#else #else
struct plat_stmmacenet_data * struct plat_stmmacenet_data *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment