diff options
-rw-r--r-- | include/net/pkt_sched.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 87496e3aa330..7352e455053c 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -140,7 +140,7 @@ psched_tod_diff(int delta_sec, int bound) | |||
140 | if (bound <= 1000000 || delta_sec > (0x7FFFFFFF/1000000)-1) | 140 | if (bound <= 1000000 || delta_sec > (0x7FFFFFFF/1000000)-1) |
141 | return bound; | 141 | return bound; |
142 | delta = delta_sec * 1000000; | 142 | delta = delta_sec * 1000000; |
143 | if (delta > bound) | 143 | if (delta > bound || delta < 0) |
144 | delta = bound; | 144 | delta = bound; |
145 | return delta; | 145 | return delta; |
146 | } | 146 | } |
@@ -156,7 +156,8 @@ psched_tod_diff(int delta_sec, int bound) | |||
156 | __delta += 1000000; \ | 156 | __delta += 1000000; \ |
157 | case 1: \ | 157 | case 1: \ |
158 | __delta += 1000000; \ | 158 | __delta += 1000000; \ |
159 | case 0: ; \ | 159 | case 0: \ |
160 | __delta = abs(__delta); \ | ||
160 | } \ | 161 | } \ |
161 | __delta; \ | 162 | __delta; \ |
162 | }) | 163 | }) |