aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/pkt_sched.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/pkt_sched.h')
-rw-r--r--include/net/pkt_sched.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 87496e3aa330..fcb05a387dbe 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)
if (bound <= 1000000 || delta_sec > (0x7FFFFFFF/1000000)-1)
return bound;
delta = delta_sec * 1000000;
- if (delta > bound)
+ if (delta > bound || delta < 0)
delta = bound;
return delta;
}
@@ -156,7 +156,9 @@ psched_tod_diff(int delta_sec, int bound)
__delta += 1000000; \
case 1: \
__delta += 1000000; \
- case 0: ; \
+ case 0: \
+ if (__delta > bound || __delta < 0) \
+ __delta = bound; \
} \
__delta; \
})