Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b3c63ac authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by David S. Miller
Browse files

[PKT_SCHED]: Fix range in psched_tod_diff() to 0..bound

parent 89c8b3a1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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,8 @@ psched_tod_diff(int delta_sec, int bound)
		   __delta += 1000000; \
	   case 1: \
		   __delta += 1000000; \
	   case 0: ; \
	   case 0: \
		   __delta = abs(__delta); \
	   } \
	   __delta; \
})