[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>
This commit is contained in:
committed by
David S. Miller
parent
716f8954fb
commit
338f7566e5
@@ -193,8 +193,10 @@ static void dev_watchdog(unsigned long arg)
|
|||||||
netif_running(dev) &&
|
netif_running(dev) &&
|
||||||
netif_carrier_ok(dev)) {
|
netif_carrier_ok(dev)) {
|
||||||
if (netif_queue_stopped(dev) &&
|
if (netif_queue_stopped(dev) &&
|
||||||
(jiffies - dev->trans_start) > dev->watchdog_timeo) {
|
time_after(jiffies, dev->trans_start + dev->watchdog_timeo)) {
|
||||||
printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n", dev->name);
|
|
||||||
|
printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n",
|
||||||
|
dev->name);
|
||||||
dev->tx_timeout(dev);
|
dev->tx_timeout(dev);
|
||||||
}
|
}
|
||||||
if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo))
|
if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo))
|
||||||
|
Reference in New Issue
Block a user