LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 3/3] memcgroup: return negative error code in mem_cgroup_create()
@ 2008-02-18 5:59 Li Zefan
2008-02-18 6:15 ` Balbir Singh
0 siblings, 1 reply; 2+ messages in thread
From: Li Zefan @ 2008-02-18 5:59 UTC (permalink / raw)
To: Andrew Morton; +Cc: Balbir Singh, KAMEZAWA Hiroyuki, LKML, containers
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>
---
mm/memcontrol.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c2959ee..4aac04c 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1101,7 +1101,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);
@@ -1117,7 +1117,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,
--
1.5.4.rc3
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-18 6:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-18 5:59 [PATCH 3/3] memcgroup: return negative error code in mem_cgroup_create() Li Zefan
2008-02-18 6:15 ` Balbir Singh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).