summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2008-02-24 00:24:14 +0100
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-24 02:13:25 +0100
commit2dda81ca31dc73e695ff8b83351f7aaefbef192a (patch)
tree808c6dd9c79f6f62851eb4108c4d7104decc7e9c /mm
parentmemcgroup: remove a useless VM_BUG_ON() (diff)
downloadlinux-2dda81ca31dc73e695ff8b83351f7aaefbef192a.tar.xz
linux-2dda81ca31dc73e695ff8b83351f7aaefbef192a.zip
memcgroup: return negative error code in mem_cgroup_create()
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index bb4d7acfbca3..631002d085d1 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -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);
@@ -1116,7 +1116,7 @@ free_out:
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,