Driver Core: x86: add nodename for cpuid and msr drivers.
[safe/jmp/linux-2.6] / kernel / cred.c
index 480a61a..1bb4d7e 100644 (file)
@@ -167,7 +167,7 @@ EXPORT_SYMBOL(prepare_creds);
 
 /*
  * Prepare credentials for current to perform an execve()
- * - The caller must hold current->cred_exec_mutex
+ * - The caller must hold current->cred_guard_mutex
  */
 struct cred *prepare_exec_creds(void)
 {
@@ -276,7 +276,7 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)
        struct cred *new;
        int ret;
 
-       mutex_init(&p->cred_exec_mutex);
+       mutex_init(&p->cred_guard_mutex);
 
        if (
 #ifdef CONFIG_KEYS
@@ -507,6 +507,7 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon)
        else
                old = get_cred(&init_cred);
 
+       *new = *old;
        get_uid(new->user);
        get_group_info(new->group_info);
 
@@ -530,6 +531,7 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon)
 
 error:
        put_cred(new);
+       put_cred(old);
        return NULL;
 }
 EXPORT_SYMBOL(prepare_kernel_cred);