summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2007-04-13 20:18:38 +0200
committerAdrian Bunk <bunk@stusta.de>2007-04-13 20:18:38 +0200
commit151ed87ad21b3ac49eed51edf1f19fb5dbee3972 (patch)
tree0d22dd67253274bd12262b4e6ae6b0a6ee566289
parent2f9ccf56f3b4e9738a68da18d9fca3d6ba612736 (diff)
downloadlwn-151ed87ad21b3ac49eed51edf1f19fb5dbee3972.tar.gz
lwn-151ed87ad21b3ac49eed51edf1f19fb5dbee3972.zip
r8169: fix a race between PCI probe and dev_open
Initialize the timer with the rest of the private-struct. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
-rw-r--r--drivers/net/r8169.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 78c532df4037..d7e1bb29838b 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1361,11 +1361,7 @@ static inline void rtl8169_request_timer(struct net_device *dev)
(tp->phy_version >= RTL_GIGA_PHY_VER_H))
return;
- init_timer(timer);
- timer->expires = jiffies + RTL8169_PHY_TIMEOUT;
- timer->data = (unsigned long)(dev);
- timer->function = rtl8169_phy_timer;
- add_timer(timer);
+ mod_timer(timer, jiffies + RTL8169_PHY_TIMEOUT);
}
#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -1644,6 +1640,10 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
tp->pci_dev = pdev;
tp->mmio_addr = ioaddr;
+ init_timer(&tp->timer);
+ tp->timer.data = (unsigned long) dev;
+ tp->timer.function = rtl8169_phy_timer;
+
spin_lock_init(&tp->lock);
rc = register_netdev(dev);