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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, March 30, 2009 - 7:00 pm

Gitweb:     http://git.kernel.org/linus/ee76db5e9e9896312f001790855a798472440328
Commit:     ee76db5e9e9896312f001790855a798472440328
Parent:     2c60b6885afc56a17b9d55b04c4328123063fc9d
Author:     David S. Miller <davem@davemloft.net>
AuthorDate: Sun Mar 29 01:19:37 2009 -0700
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Sun Mar 29 01:19:37 2009 -0700

    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 <davem@davemloft.net>
---
 drivers/net/gianfar.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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);
 	}
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
gianfar: Fix use-after-of_node_put() in gfar_of_init()., Linux Kernel Mailing ..., (Mon Mar 30, 7:00 pm)