From: David S. Miller Date: Sun, 29 Mar 2009 08:19:37 +0000 (-0700) Subject: gianfar: Fix use-after-of_node_put() in gfar_of_init(). X-Git-Tag: v3.0~9763^2~75 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee76db5e9e9896312f001790855a798472440328;p=platform%2Fkernel%2Flinux-amlogic.git 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. Signed-off-by: David S. Miller --- diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 6a38800..65f5587 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c @@ -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); }