diff options
Diffstat (limited to 'kernel/user_namespace.c')
-rw-r--r-- | kernel/user_namespace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c index 89a27e8b17fb..d055d987850c 100644 --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c | |||
@@ -34,7 +34,7 @@ static struct user_namespace *clone_user_ns(struct user_namespace *old_ns) | |||
34 | 34 | ||
35 | ns = kmalloc(sizeof(struct user_namespace), GFP_KERNEL); | 35 | ns = kmalloc(sizeof(struct user_namespace), GFP_KERNEL); |
36 | if (!ns) | 36 | if (!ns) |
37 | return NULL; | 37 | return ERR_PTR(-ENOMEM); |
38 | 38 | ||
39 | kref_init(&ns->kref); | 39 | kref_init(&ns->kref); |
40 | 40 | ||
@@ -45,7 +45,7 @@ static struct user_namespace *clone_user_ns(struct user_namespace *old_ns) | |||
45 | ns->root_user = alloc_uid(ns, 0); | 45 | ns->root_user = alloc_uid(ns, 0); |
46 | if (!ns->root_user) { | 46 | if (!ns->root_user) { |
47 | kfree(ns); | 47 | kfree(ns); |
48 | return NULL; | 48 | return ERR_PTR(-ENOMEM); |
49 | } | 49 | } |
50 | 50 | ||
51 | /* Reset current->user with a new one */ | 51 | /* Reset current->user with a new one */ |
@@ -53,7 +53,7 @@ static struct user_namespace *clone_user_ns(struct user_namespace *old_ns) | |||
53 | if (!new_user) { | 53 | if (!new_user) { |
54 | free_uid(ns->root_user); | 54 | free_uid(ns->root_user); |
55 | kfree(ns); | 55 | kfree(ns); |
56 | return NULL; | 56 | return ERR_PTR(-ENOMEM); |
57 | } | 57 | } |
58 | 58 | ||
59 | switch_uid(new_user); | 59 | switch_uid(new_user); |