Skip to content

Commit

Permalink
memcgroup: return negative error code in mem_cgroup_create()
Browse files Browse the repository at this point in the history
Cgroup requires the subsystem to return negative error code on error in the
create method.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Li Zefan authored and Linus Torvalds committed Feb 24, 2008
1 parent 7fde4c3 commit 2dda81c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
mem = kzalloc(sizeof(struct mem_cgroup), GFP_KERNEL);

if (mem == NULL)
return NULL;
return ERR_PTR(-ENOMEM);

res_counter_init(&mem->res);

Expand All @@ -1116,7 +1116,7 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
free_mem_cgroup_per_zone_info(mem, node);
if (cont->parent != NULL)
kfree(mem);
return NULL;
return ERR_PTR(-ENOMEM);
}

static void mem_cgroup_pre_destroy(struct cgroup_subsys *ss,
Expand Down

0 comments on commit 2dda81c

Please sign in to comment.