aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 793f37176077..0eb7b868e1ab 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4158,7 +4158,7 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
4158 struct cgroup *cgrp; 4158 struct cgroup *cgrp;
4159 struct cgroup_name *name; 4159 struct cgroup_name *name;
4160 struct cgroupfs_root *root = parent->root; 4160 struct cgroupfs_root *root = parent->root;
4161 int ssid, err = 0; 4161 int ssid, err;
4162 struct cgroup_subsys *ss; 4162 struct cgroup_subsys *ss;
4163 struct super_block *sb = root->sb; 4163 struct super_block *sb = root->sb;
4164 4164
@@ -4168,8 +4168,10 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
4168 return -ENOMEM; 4168 return -ENOMEM;
4169 4169
4170 name = cgroup_alloc_name(dentry); 4170 name = cgroup_alloc_name(dentry);
4171 if (!name) 4171 if (!name) {
4172 err = -ENOMEM;
4172 goto err_free_cgrp; 4173 goto err_free_cgrp;
4174 }
4173 rcu_assign_pointer(cgrp->name, name); 4175 rcu_assign_pointer(cgrp->name, name);
4174 4176
4175 /* 4177 /*
@@ -4177,8 +4179,10 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
4177 * a half-baked cgroup. 4179 * a half-baked cgroup.
4178 */ 4180 */
4179 cgrp->id = idr_alloc(&root->cgroup_idr, NULL, 1, 0, GFP_KERNEL); 4181 cgrp->id = idr_alloc(&root->cgroup_idr, NULL, 1, 0, GFP_KERNEL);
4180 if (cgrp->id < 0) 4182 if (cgrp->id < 0) {
4183 err = -ENOMEM;
4181 goto err_free_name; 4184 goto err_free_name;
4185 }
4182 4186
4183 /* 4187 /*
4184 * Only live parents can have children. Note that the liveliness 4188 * Only live parents can have children. Note that the liveliness