net: avoid overflow when rose /proc displays timer information.
[linux-2.6-block.git] / net / ax25 / ax25_timer.c
index 85865ebfdfa2e503224e3991eb2c820708eb31a1..9f7cb0a7c73f698687c73f0457e7ddb795ae8a17 100644 (file)
@@ -108,10 +108,12 @@ int ax25_t1timer_running(ax25_cb *ax25)
 
 unsigned long ax25_display_timer(struct timer_list *timer)
 {
+       long delta = timer->expires - jiffies;
+
        if (!timer_pending(timer))
                return 0;
 
-       return timer->expires - jiffies;
+       return max(0L, delta);
 }
 
 EXPORT_SYMBOL(ax25_display_timer);