aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/posix-timers.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 10349d5f2ec3..7edfe4b901e7 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -639,6 +639,13 @@ static struct k_itimer *__lock_timer(timer_t timer_id, unsigned long *flags)
639{ 639{
640 struct k_itimer *timr; 640 struct k_itimer *timr;
641 641
642 /*
643 * timer_t could be any type >= int and we want to make sure any
644 * @timer_id outside positive int range fails lookup.
645 */
646 if ((unsigned long long)timer_id > INT_MAX)
647 return NULL;
648
642 rcu_read_lock(); 649 rcu_read_lock();
643 timr = idr_find(&posix_timers_id, (int)timer_id); 650 timr = idr_find(&posix_timers_id, (int)timer_id);
644 if (timr) { 651 if (timr) {