Fix cs8900 dev->priv not init issue
authorHui.Tang <zetalabs@gmail.com>
Thu, 5 Nov 2009 01:58:44 +0000 (09:58 +0800)
committerBen Warren <biggerbadderben@gmail.com>
Mon, 9 Nov 2009 18:39:36 +0000 (10:39 -0800)
Ensure all CS8900 data structures are assigned before accessing device

Signed-off-by: Hui.Tang <zetalabs@gmail.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
drivers/net/cs8900.c

index 587f7f62a760308fc3c39331d68f600056d42e35..a9d1f22734910d156fa932041623a05181055c16 100644 (file)
@@ -321,15 +321,16 @@ int cs8900_initialize(u8 dev_num, int base_addr)
        memset(priv, 0, sizeof(*priv));
        priv->regs = (struct cs8900_regs *)base_addr;
 
-       /* Load MAC address from EEPROM */
-       cs8900_get_enetaddr(dev);
-
        dev->iobase = base_addr;
        dev->priv = priv;
        dev->init = cs8900_init;
        dev->halt = cs8900_halt;
        dev->send = cs8900_send;
        dev->recv = cs8900_recv;
+
+       /* Load MAC address from EEPROM */
+       cs8900_get_enetaddr(dev);
+
        sprintf(dev->name, "%s-%hu", CS8900_DRIVERNAME, dev_num);
 
        eth_register(dev);