summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index afb1205fc789..d92d91a4bb3e 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -6083,10 +6083,11 @@ struct cgroup_namespace *copy_cgroup_ns(unsigned long flags,
spin_unlock_bh(&css_set_lock);
mutex_unlock(&cgroup_mutex);
- err = -ENOMEM;
new_ns = alloc_cgroup_ns();
- if (!new_ns)
+ if (IS_ERR(new_ns)) {
+ err = PTR_ERR(new_ns);
goto err_out;
+ }
new_ns->user_ns = get_user_ns(user_ns);
new_ns->root_cset = cset;