stmmac: add missing of_node_put
authorJulia Lawall <julia.lawall@lip6.fr>
Tue, 17 Jan 2017 11:23:21 +0000 (12:23 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 03:04:44 +0000 (03:04 +0000)
commit8f51353d46d9d0b3c040c65fe62fe0a0969dc36d
tree632fb78dab757a1ce7d8f47c039dfd16f7a133f7
parent7d2cf1c0c9df0d126fafaa50c13138781b78c98b
stmmac: add missing of_node_put

[ Upstream commit a249708bc2aa1fe3ddf15dfac22bee519d15996b ]

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: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c