aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/posix-timers.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/posix-timers.c')
-rw-r--r--kernel/posix-timers.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 00d1fda58ab6..9ca4973f736d 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -559,19 +559,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
559 new_timer->it_id = (timer_t) new_timer_id; 559 new_timer->it_id = (timer_t) new_timer_id;
560 new_timer->it_clock = which_clock; 560 new_timer->it_clock = which_clock;
561 new_timer->it_overrun = -1; 561 new_timer->it_overrun = -1;
562 error = CLOCK_DISPATCH(which_clock, timer_create, (new_timer));
563 if (error)
564 goto out;
565 562
566 /*
567 * return the timer_id now. The next step is hard to
568 * back out if there is an error.
569 */
570 if (copy_to_user(created_timer_id,
571 &new_timer_id, sizeof (new_timer_id))) {
572 error = -EFAULT;
573 goto out;
574 }
575 if (timer_event_spec) { 563 if (timer_event_spec) {
576 if (copy_from_user(&event, timer_event_spec, sizeof (event))) { 564 if (copy_from_user(&event, timer_event_spec, sizeof (event))) {
577 error = -EFAULT; 565 error = -EFAULT;
@@ -597,6 +585,16 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
597 new_timer->sigq->info.si_tid = new_timer->it_id; 585 new_timer->sigq->info.si_tid = new_timer->it_id;
598 new_timer->sigq->info.si_code = SI_TIMER; 586 new_timer->sigq->info.si_code = SI_TIMER;
599 587
588 if (copy_to_user(created_timer_id,
589 &new_timer_id, sizeof (new_timer_id))) {
590 error = -EFAULT;
591 goto out;
592 }
593
594 error = CLOCK_DISPATCH(which_clock, timer_create, (new_timer));
595 if (error)
596 goto out;
597
600 spin_lock_irq(&current->sighand->siglock); 598 spin_lock_irq(&current->sighand->siglock);
601 new_timer->it_signal = current->signal; 599 new_timer->it_signal = current->signal;
602 list_add(&new_timer->list, &current->signal->posix_timers); 600 list_add(&new_timer->list, &current->signal->posix_timers);