]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/x86/kernel/process.c
Merge branch 'tracing/core-v2' into tracing-for-linus
[mv-sheeva.git] / arch / x86 / kernel / process.c
index 8c037051b3537c4f5da2d02e5b69e0fc4ec6aa2b..62fc75b67e450cb368e41c4bf34685f0cbe069bd 100644 (file)
@@ -68,11 +68,11 @@ void exit_thread(void)
 {
        struct task_struct *me = current;
        struct thread_struct *t = &me->thread;
+       unsigned long *bp = t->io_bitmap_ptr;
 
-       if (me->thread.io_bitmap_ptr) {
+       if (bp) {
                struct tss_struct *tss = &per_cpu(init_tss, get_cpu());
 
-               kfree(t->io_bitmap_ptr);
                t->io_bitmap_ptr = NULL;
                clear_thread_flag(TIF_IO_BITMAP);
                /*
@@ -81,6 +81,7 @@ void exit_thread(void)
                memset(tss->io_bitmap, 0xff, t->io_bitmap_max);
                t->io_bitmap_max = 0;
                put_cpu();
+               kfree(bp);
        }
 
        ds_exit_thread(current);