aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/posix-timers.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 3eff47b0d8d5..7185f05d53a9 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -474,8 +474,7 @@ sys_timer_create(const clockid_t which_clock,
474 goto out; 474 goto out;
475 } 475 }
476 spin_lock_irq(&idr_lock); 476 spin_lock_irq(&idr_lock);
477 error = idr_get_new(&posix_timers_id, (void *) new_timer, 477 error = idr_get_new(&posix_timers_id, new_timer, &new_timer_id);
478 &new_timer_id);
479 spin_unlock_irq(&idr_lock); 478 spin_unlock_irq(&idr_lock);
480 if (error) { 479 if (error) {
481 if (error == -EAGAIN) 480 if (error == -EAGAIN)
@@ -567,12 +566,12 @@ static struct k_itimer * lock_timer(timer_t timer_id, unsigned long *flags)
567 */ 566 */
568 567
569 spin_lock_irqsave(&idr_lock, *flags); 568 spin_lock_irqsave(&idr_lock, *flags);
570 timr = (struct k_itimer *) idr_find(&posix_timers_id, (int) timer_id); 569 timr = idr_find(&posix_timers_id, (int) timer_id);
571 if (timr) { 570 if (timr) {
572 spin_lock(&timr->it_lock); 571 spin_lock(&timr->it_lock);
573 572
574 if ((timr->it_id != timer_id) || !(timr->it_process) || 573 if (!timr->it_process ||
575 !same_thread_group(timr->it_process, current)) { 574 !same_thread_group(timr->it_process, current)) {
576 spin_unlock(&timr->it_lock); 575 spin_unlock(&timr->it_lock);
577 spin_unlock_irqrestore(&idr_lock, *flags); 576 spin_unlock_irqrestore(&idr_lock, *flags);
578 timr = NULL; 577 timr = NULL;