提交 d09e18bc 编写于 作者: V Valentine Barshak 提交者: Jeff Garzik

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: NValentine Barshak <vbarshak@ru.mvista.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 63b6cad7
......@@ -116,13 +116,14 @@ static int __devinit tah_probe(struct of_device *ofdev,
goto err_free;
}
dev_set_drvdata(&ofdev->dev, dev);
/* Initialize TAH and enable IPv4 checksum verification, no TSO yet */
tah_reset(ofdev);
printk(KERN_INFO
"TAH %s initialized\n", ofdev->node->full_name);
wmb();
dev_set_drvdata(&ofdev->dev, dev);
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册