]> git.baikalelectronics.ru Git - kernel.git/commit
net: mvneta: Fix reference counting for phy_node
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 7 Aug 2014 19:58:46 +0000 (21:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Aug 2014 23:02:58 +0000 (16:02 -0700)
commit40920d0e6353204ccb9e00006b428929a6e00508
tree80e60ad7b5136a529507c97198afcd8c6ac78208
parentb65a875d807beea5c366cf2a2f90cd09e6fd75ce
net: mvneta: Fix reference counting for phy_node

If there is a "phy" handle the probe function returns with holding a
reference to that node. Make sure that in the fixed phy case there is
also held a reference to yield a consistant state.

Also add the corresponding of_node_put in the error path and the remove
function.

Fixes: d98c778bc17e ("net: mvneta: add support for fixed links")
Fixes: 74510ae74238 ("net: mvneta: driver for Marvell Armada 370/XP network unit")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvneta.c