diff options
Diffstat (limited to 'kernel/user.c')
-rw-r--r-- | kernel/user.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/kernel/user.c b/kernel/user.c index debce602bfdd..aefbbfa3159f 100644 --- a/kernel/user.c +++ b/kernel/user.c | |||
@@ -53,10 +53,6 @@ struct user_struct root_user = { | |||
53 | .files = ATOMIC_INIT(0), | 53 | .files = ATOMIC_INIT(0), |
54 | .sigpending = ATOMIC_INIT(0), | 54 | .sigpending = ATOMIC_INIT(0), |
55 | .locked_shm = 0, | 55 | .locked_shm = 0, |
56 | #ifdef CONFIG_KEYS | ||
57 | .uid_keyring = &root_user_keyring, | ||
58 | .session_keyring = &root_session_keyring, | ||
59 | #endif | ||
60 | #ifdef CONFIG_USER_SCHED | 56 | #ifdef CONFIG_USER_SCHED |
61 | .tg = &init_task_group, | 57 | .tg = &init_task_group, |
62 | #endif | 58 | #endif |
@@ -420,12 +416,12 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid) | |||
420 | new->mq_bytes = 0; | 416 | new->mq_bytes = 0; |
421 | #endif | 417 | #endif |
422 | new->locked_shm = 0; | 418 | new->locked_shm = 0; |
423 | 419 | #ifdef CONFIG_KEYS | |
424 | if (alloc_uid_keyring(new, current) < 0) | 420 | new->uid_keyring = new->session_keyring = NULL; |
425 | goto out_free_user; | 421 | #endif |
426 | 422 | ||
427 | if (sched_create_user(new) < 0) | 423 | if (sched_create_user(new) < 0) |
428 | goto out_put_keys; | 424 | goto out_free_user; |
429 | 425 | ||
430 | if (uids_user_create(new)) | 426 | if (uids_user_create(new)) |
431 | goto out_destoy_sched; | 427 | goto out_destoy_sched; |
@@ -459,9 +455,6 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid) | |||
459 | 455 | ||
460 | out_destoy_sched: | 456 | out_destoy_sched: |
461 | sched_destroy_user(new); | 457 | sched_destroy_user(new); |
462 | out_put_keys: | ||
463 | key_put(new->uid_keyring); | ||
464 | key_put(new->session_keyring); | ||
465 | out_free_user: | 458 | out_free_user: |
466 | kmem_cache_free(uid_cachep, new); | 459 | kmem_cache_free(uid_cachep, new); |
467 | out_unlock: | 460 | out_unlock: |