Commit 2efa53f3 authored by Francois Romieu's avatar Francois Romieu Committed by Jeff Garzik

r8169: fix a race between PCI probe and dev_open

Initialize the timer with the rest of the private-struct.
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 9e0db8ef
...@@ -1368,11 +1368,7 @@ static inline void rtl8169_request_timer(struct net_device *dev) ...@@ -1368,11 +1368,7 @@ static inline void rtl8169_request_timer(struct net_device *dev)
(tp->phy_version >= RTL_GIGA_PHY_VER_H)) (tp->phy_version >= RTL_GIGA_PHY_VER_H))
return; return;
init_timer(timer); mod_timer(timer, jiffies + RTL8169_PHY_TIMEOUT);
timer->expires = jiffies + RTL8169_PHY_TIMEOUT;
timer->data = (unsigned long)(dev);
timer->function = rtl8169_phy_timer;
add_timer(timer);
} }
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
...@@ -1685,6 +1681,10 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1685,6 +1681,10 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
tp->mmio_addr = ioaddr; tp->mmio_addr = ioaddr;
tp->align = rtl_cfg_info[ent->driver_data].align; tp->align = rtl_cfg_info[ent->driver_data].align;
init_timer(&tp->timer);
tp->timer.data = (unsigned long) dev;
tp->timer.function = rtl8169_phy_timer;
spin_lock_init(&tp->lock); spin_lock_init(&tp->lock);
rc = register_netdev(dev); rc = register_netdev(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment