printk: do not handle non-sleepable notification in console_cpu_notify
[linux-2.6.git] / kernel / exec_domain.c
index dd62f8e..0dbeae3 100644 (file)
@@ -134,23 +134,14 @@ unregister:
        return 0;
 }
 
-int
-__set_personality(unsigned int personality)
+int __set_personality(unsigned int personality)
 {
-       struct exec_domain      *ep, *oep;
-
-       ep = lookup_exec_domain(personality);
-       if (ep == current_thread_info()->exec_domain) {
-               current->personality = personality;
-               module_put(ep->module);
-               return 0;
-       }
+       struct exec_domain *oep = current_thread_info()->exec_domain;
 
+       current_thread_info()->exec_domain = lookup_exec_domain(personality);
        current->personality = personality;
-       oep = current_thread_info()->exec_domain;
-       current_thread_info()->exec_domain = ep;
-
        module_put(oep->module);
+
        return 0;
 }
 
@@ -192,11 +183,8 @@ SYSCALL_DEFINE1(personality, unsigned int, personality)
 {
        unsigned int old = current->personality;
 
-       if (personality != 0xffffffff) {
+       if (personality != 0xffffffff)
                set_personality(personality);
-               if (current->personality != personality)
-                       return -EINVAL;
-       }
 
        return old;
 }