net: ethernet: ti: cpsw: fix device and of_node leaks
authorJohan Hovold <johan@kernel.org>
Thu, 3 Nov 2016 17:40:20 +0000 (18:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Nov 2016 18:17:30 +0000 (13:17 -0500)
commitc7262aaace1b17a650598063e3b9ee1785fde377
tree71663e0ba7eeee15e58b969f67eb759d31f88812
parent17ae1c650c1ecf8dc8e16d54b0f68a345965f43f
net: ethernet: ti: cpsw: fix device and of_node leaks

Make sure to drop the references taken by of_get_child_by_name() and
bus_find_device() before returning from cpsw_phy_sel().

Note that holding a reference to the cpsw-phy-sel device does not
prevent the devres-managed private data from going away.

Fixes: 5892cd135e16 ("drivers: net: cpsw-phy-sel: Add new driver...")
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw-phy-sel.c