Skip to contentSkip to conversation

: gianfar: Fix use-after-of_node_put() in gfar_of_init().

PATCH New David Miller 1 participant 1 message Mar 29, 2009

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/2 : gianfar: Fix use-after-of_node_put() in gfar_of_init().

We can't put 'mdio' until after we've used it in the fsl_pq_mdio_bus_name() call.

---
 drivers/net/gianfar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/gianfar.c +1 -1
index 6a38800..65f5587 100644
@@ -289,9 +289,9 @@ static int gfar_of_init(struct net_device *dev)
 		id = of_get_property(phy, "reg", NULL);
 
 		of_node_put(phy);
-		of_node_put(mdio);
 
 		fsl_pq_mdio_bus_name(bus_name, mdio);
+		of_node_put(mdio);
 		snprintf(priv->phy_bus_id, sizeof(priv->phy_bus_id), "%s:%02x",
 				bus_name, *id);
 	}
Signature · 1 line
1.6.2.1.222.g570cc