diff --git a/[refs] b/[refs] index e0d034c77c16..5596d6a6f368 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9fb4b7cc0724f178d4b24a2a566ea1e7cb120b82 +refs/heads/master: c3cecc683446ad54ca587d7123bd3ce94bd7b8e1 diff --git a/trunk/mm/memcontrol.c b/trunk/mm/memcontrol.c index 4c53e971749e..2a1f7847b6ad 100644 --- a/trunk/mm/memcontrol.c +++ b/trunk/mm/memcontrol.c @@ -4960,7 +4960,7 @@ static int mem_cgroup_soft_limit_tree_init(void) tmp = -1; rtpn = kzalloc_node(sizeof(*rtpn), GFP_KERNEL, tmp); if (!rtpn) - return 1; + goto err_cleanup; soft_limit_tree.rb_tree_per_node[node] = rtpn; @@ -4971,6 +4971,16 @@ static int mem_cgroup_soft_limit_tree_init(void) } } return 0; + +err_cleanup: + for_each_node_state(node, N_POSSIBLE) { + if (!soft_limit_tree.rb_tree_per_node[node]) + break; + kfree(soft_limit_tree.rb_tree_per_node[node]); + soft_limit_tree.rb_tree_per_node[node] = NULL; + } + return 1; + } static struct cgroup_subsys_state * __ref