]> git.baikalelectronics.ru Git - kernel.git/commit
net: fs_enet: fix reference counting for phy_node
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 7 Aug 2014 21:06:00 +0000 (23:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Aug 2014 23:02:59 +0000 (16:02 -0700)
commit7e3eea0b65712379f85bb5376fcb5909aa911d12
tree6ab2652fb4375470a20f2c4fff8691b0fdd7ccf8
parent7e78794855627efa9f96eda00093c53d911360eb
net: fs_enet: fix reference counting for phy_node

Make sure that fs_enet_probe is left with a reference to the phy node.
In the presence of a phy handle this is already the case as
of_parse_phandle returns a reference. In the fixed phy case a call to
of_node_get is necessary. Otherwise the error path and remove function
drop a reference the driver isn't holding.

Fixes: 17b428889801 ("fs_enet: use the new fixed PHY helpers")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c