]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - kernel/posix-timers.c
drivers/gpu/drm: Remove unnecessary casts of private_data
[net-next-2.6.git] / kernel / posix-timers.c
index ad723420acc3e765b12cf393f3cd22a754d80206..9ca4973f736d53b04bf4eea9373ce635cf7098c3 100644 (file)
@@ -560,11 +560,6 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
        new_timer->it_clock = which_clock;
        new_timer->it_overrun = -1;
 
-       if (copy_to_user(created_timer_id,
-                        &new_timer_id, sizeof (new_timer_id))) {
-               error = -EFAULT;
-               goto out;
-       }
        if (timer_event_spec) {
                if (copy_from_user(&event, timer_event_spec, sizeof (event))) {
                        error = -EFAULT;
@@ -590,6 +585,12 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
        new_timer->sigq->info.si_tid   = new_timer->it_id;
        new_timer->sigq->info.si_code  = SI_TIMER;
 
+       if (copy_to_user(created_timer_id,
+                        &new_timer_id, sizeof (new_timer_id))) {
+               error = -EFAULT;
+               goto out;
+       }
+
        error = CLOCK_DISPATCH(which_clock, timer_create, (new_timer));
        if (error)
                goto out;