aboutsummaryrefslogtreecommitdiff
path: root/kernel/cred.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cred.c')
-rw-r--r--kernel/cred.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/cred.c b/kernel/cred.c
index 480a61aec80..3a039189d70 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -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);