]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/exit.c
block: blkdev.h cleanup, move iocontext stuff to iocontext.h
[linux-2.6-omap-h63xx.git] / kernel / exit.c
index 1510f78a0ffa5a9496604b3acee679ca63d93c99..ceb258782835a1073774e0337e0bc4d85f7a160f 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/personality.h>
 #include <linux/tty.h>
 #include <linux/mnt_namespace.h>
+#include <linux/iocontext.h>
 #include <linux/key.h>
 #include <linux/security.h>
 #include <linux/cpu.h>
@@ -126,6 +127,12 @@ static void __exit_signal(struct task_struct *tsk)
 
        __unhash_process(tsk);
 
+       /*
+        * Do this under ->siglock, we can race with another thread
+        * doing sigqueue_free() if we have SIGQUEUE_PREALLOC signals.
+        */
+       flush_sigqueue(&tsk->pending);
+
        tsk->signal = NULL;
        tsk->sighand = NULL;
        spin_unlock(&sighand->siglock);
@@ -133,7 +140,6 @@ static void __exit_signal(struct task_struct *tsk)
 
        __cleanup_sighand(sighand);
        clear_tsk_thread_flag(tsk,TIF_SIGPENDING);
-       flush_sigqueue(&tsk->pending);
        if (sig) {
                flush_sigqueue(&sig->shared_pending);
                taskstats_tgid_free(sig);