Merge branch 'linux-2.6' into for-2.6.24
[linux-2.6-block.git] / fs / exec.c
index ce62f7b65f17aa3963c67c8ff095974489b4f033..c21a8cc0627709db512597ff2af82ab7c094e67d 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -779,19 +779,12 @@ static int de_thread(struct task_struct *tsk)
        struct task_struct *leader = NULL;
        int count;
 
-       /*
-        * Tell all the sighand listeners that this sighand has
-        * been detached. The signalfd_detach() function grabs the
-        * sighand lock, if signal listeners are present on the sighand.
-        */
-       signalfd_detach(tsk);
-
        /*
         * If we don't share sighandlers, then we aren't sharing anything
         * and we can just re-use it all.
         */
        if (atomic_read(&oldsighand->count) <= 1) {
-               BUG_ON(atomic_read(&sig->count) != 1);
+               signalfd_detach(tsk);
                exit_itimers(sig);
                return 0;
        }
@@ -930,12 +923,11 @@ static int de_thread(struct task_struct *tsk)
        sig->flags = 0;
 
 no_thread_group:
+       signalfd_detach(tsk);
        exit_itimers(sig);
        if (leader)
                release_task(leader);
 
-       BUG_ON(atomic_read(&sig->count) != 1);
-
        if (atomic_read(&oldsighand->count) == 1) {
                /*
                 * Now that we nuked the rest of the thread group,