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>

authored by Li Zefan and committed by Linus Torvalds 2dda81ca 7fde4c3e

+2 -2
+2 -2
mm/memcontrol.c
··· 1100 1100 mem = kzalloc(sizeof(struct mem_cgroup), GFP_KERNEL); 1101 1101 1102 1102 if (mem == NULL) 1103 - return NULL; 1103 + return ERR_PTR(-ENOMEM); 1104 1104 1105 1105 res_counter_init(&mem->res); 1106 1106 ··· 1116 1116 free_mem_cgroup_per_zone_info(mem, node); 1117 1117 if (cont->parent != NULL) 1118 1118 kfree(mem); 1119 - return NULL; 1119 + return ERR_PTR(-ENOMEM); 1120 1120 } 1121 1121 1122 1122 static void mem_cgroup_pre_destroy(struct cgroup_subsys *ss,