aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorValentine Barshak <vbarshak@ru.mvista.com>2007-12-04 19:14:32 -0500
committerJeff Garzik <jeff@garzik.org>2007-12-07 15:09:06 -0500
commitd09e18bc194c3fa8ae880df4567c719c36a73e9e (patch)
tree9408f49b0ace39e09c60bb0f18ce6d85808395fa
parent63b6cad795e0a34e8670291943df8a6f653c1931 (diff)
ibm_newemac: Call dev_set_drvdata() before tah_reset()
The patch moves dev_set_drvdata(&ofdev->dev, dev) up before tah_reset(ofdev) is called to avoid a NULL pointer dereference, since tah_reset uses drvdata. Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/ibm_newemac/tah.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ibm_newemac/tah.c b/drivers/net/ibm_newemac/tah.c
index f161fb100e8e..6e35cbe15931 100644
--- a/drivers/net/ibm_newemac/tah.c
+++ b/drivers/net/ibm_newemac/tah.c
@@ -116,13 +116,14 @@ static int __devinit tah_probe(struct of_device *ofdev,
116 goto err_free; 116 goto err_free;
117 } 117 }
118 118
119 dev_set_drvdata(&ofdev->dev, dev);
120
119 /* Initialize TAH and enable IPv4 checksum verification, no TSO yet */ 121 /* Initialize TAH and enable IPv4 checksum verification, no TSO yet */
120 tah_reset(ofdev); 122 tah_reset(ofdev);
121 123
122 printk(KERN_INFO 124 printk(KERN_INFO
123 "TAH %s initialized\n", ofdev->node->full_name); 125 "TAH %s initialized\n", ofdev->node->full_name);
124 wmb(); 126 wmb();
125 dev_set_drvdata(&ofdev->dev, dev);
126 127
127 return 0; 128 return 0;
128 129