LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
LKML <linux-kernel@vger.kernel.org>,
containers@lists.linux-foundation.org
Subject: [PATCH 3/3] memcgroup: return negative error code in mem_cgroup_create()
Date: Mon, 18 Feb 2008 13:59:37 +0800 [thread overview]
Message-ID: <47B91EC9.7080606@cn.fujitsu.com> (raw)
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
next reply other threads:[~2008-02-18 6:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-18 5:59 Li Zefan [this message]
2008-02-18 6:15 ` Balbir Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47B91EC9.7080606@cn.fujitsu.com \
--to=lizf@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=containers@lists.linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--subject='Re: [PATCH 3/3] memcgroup: return negative error code in mem_cgroup_create()' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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).