Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[pandora-kernel.git] / kernel / posix-timers.c
index 329ce01..7a15afb 100644 (file)
@@ -241,7 +241,7 @@ static __init int init_posix_timers(void)
        register_posix_clock(CLOCK_MONOTONIC, &clock_monotonic);
 
        posix_timers_cache = kmem_cache_create("posix_timers_cache",
-                                       sizeof (struct k_itimer), 0, 0, NULL, NULL);
+                                       sizeof (struct k_itimer), 0, 0, NULL);
        idr_init(&posix_timers_id);
        return 0;
 }
@@ -547,9 +547,9 @@ sys_timer_create(const clockid_t which_clock,
                                new_timer->it_process = process;
                                list_add(&new_timer->list,
                                         &process->signal->posix_timers);
-                               spin_unlock_irqrestore(&process->sighand->siglock, flags);
                                if (new_timer->it_sigev_notify == (SIGEV_SIGNAL|SIGEV_THREAD_ID))
                                        get_task_struct(process);
+                               spin_unlock_irqrestore(&process->sighand->siglock, flags);
                        } else {
                                spin_unlock_irqrestore(&process->sighand->siglock, flags);
                                process = NULL;
@@ -605,13 +605,14 @@ static struct k_itimer * lock_timer(timer_t timer_id, unsigned long *flags)
        timr = (struct k_itimer *) idr_find(&posix_timers_id, (int) timer_id);
        if (timr) {
                spin_lock(&timr->it_lock);
-               spin_unlock(&idr_lock);
 
                if ((timr->it_id != timer_id) || !(timr->it_process) ||
                                timr->it_process->tgid != current->tgid) {
-                       unlock_timer(timr, *flags);
+                       spin_unlock(&timr->it_lock);
+                       spin_unlock_irqrestore(&idr_lock, *flags);
                        timr = NULL;
-               }
+               } else
+                       spin_unlock(&idr_lock);
        } else
                spin_unlock_irqrestore(&idr_lock, *flags);