From: Patrick McHardy Date: Tue, 3 May 2005 21:41:18 +0000 (-0700) Subject: [PKT_SCHED]: Fix range in PSCHED_TDIFF_SAFE to 0..bound X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9dfa277f88388a94993b121db46b80df66f48d9e;p=openwrt%2Fstaging%2Fblogic.git [PKT_SCHED]: Fix range in PSCHED_TDIFF_SAFE to 0..bound Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 7352e455053c..fcb05a387dbe 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h @@ -157,7 +157,8 @@ psched_tod_diff(int delta_sec, int bound) case 1: \ __delta += 1000000; \ case 0: \ - __delta = abs(__delta); \ + if (__delta > bound || __delta < 0) \ + __delta = bound; \ } \ __delta; \ })