Skip to content

Commit

Permalink
[PKT_SCHED]: Fix range in psched_tod_diff() to 0..bound
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nicolas Dichtel authored and David S. Miller committed Apr 28, 2005
1 parent 89c8b3a commit 7b3c63a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/net/pkt_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -156,7 +156,8 @@ psched_tod_diff(int delta_sec, int bound)
__delta += 1000000; \
case 1: \
__delta += 1000000; \
case 0: ; \
case 0: \
__delta = abs(__delta); \
} \
__delta; \
})
Expand Down

0 comments on commit 7b3c63a

Please sign in to comment.