x86/ioperm: Remove bitmap if all permissions dropped
[linux-2.6-microblaze.git] / arch / x86 / kernel / process.c
index 108af91..7ba4d54 100644 (file)
@@ -102,21 +102,10 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
 void exit_thread(struct task_struct *tsk)
 {
        struct thread_struct *t = &tsk->thread;
-       struct io_bitmap *iobm = t->io_bitmap;
        struct fpu *fpu = &t->fpu;
-       struct tss_struct *tss;
-
-       if (iobm) {
-               preempt_disable();
-               tss = this_cpu_ptr(&cpu_tss_rw);
-
-               t->io_bitmap = NULL;
-               clear_thread_flag(TIF_IO_BITMAP);
-               /* Invalidate the io bitmap base in the TSS */
-               tss->x86_tss.io_bitmap_base = IO_BITMAP_OFFSET_INVALID;
-               preempt_enable();
-               kfree(iobm);
-       }
+
+       if (test_thread_flag(TIF_IO_BITMAP))
+               io_bitmap_exit();
 
        free_vm86(t);