aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-05-16 18:02:12 -0400
committerDavid S. Miller <davem@davemloft.net>2006-05-16 18:02:12 -0400
commit338f7566e5c26a9547e25d54863ae4e4e5c856d1 (patch)
treefbe483e07f8680a7718e02b869cdf5e042e2ec7b /net
parent716f8954fb3029ca2df52a986b60af8d06f093ee (diff)
[PKT_SCHED]: Potential jiffy wrap bug in dev_watchdog().
There is a potential jiffy wraparound bug in the transmit watchdog that is easily avoided by using time_after(). Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/sched/sch_generic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 31eb83717c26..138ea92ed268 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -193,8 +193,10 @@ static void dev_watchdog(unsigned long arg)
193 netif_running(dev) && 193 netif_running(dev) &&
194 netif_carrier_ok(dev)) { 194 netif_carrier_ok(dev)) {
195 if (netif_queue_stopped(dev) && 195 if (netif_queue_stopped(dev) &&
196 (jiffies - dev->trans_start) > dev->watchdog_timeo) { 196 time_after(jiffies, dev->trans_start + dev->watchdog_timeo)) {
197 printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n", dev->name); 197
198 printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n",
199 dev->name);
198 dev->tx_timeout(dev); 200 dev->tx_timeout(dev);
199 } 201 }
200 if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo)) 202 if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo))