diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memcontrol.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4c53e971749e..2a1f7847b6ad 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -4960,7 +4960,7 @@ static int mem_cgroup_soft_limit_tree_init(void) | |||
4960 | tmp = -1; | 4960 | tmp = -1; |
4961 | rtpn = kzalloc_node(sizeof(*rtpn), GFP_KERNEL, tmp); | 4961 | rtpn = kzalloc_node(sizeof(*rtpn), GFP_KERNEL, tmp); |
4962 | if (!rtpn) | 4962 | if (!rtpn) |
4963 | return 1; | 4963 | goto err_cleanup; |
4964 | 4964 | ||
4965 | soft_limit_tree.rb_tree_per_node[node] = rtpn; | 4965 | soft_limit_tree.rb_tree_per_node[node] = rtpn; |
4966 | 4966 | ||
@@ -4971,6 +4971,16 @@ static int mem_cgroup_soft_limit_tree_init(void) | |||
4971 | } | 4971 | } |
4972 | } | 4972 | } |
4973 | return 0; | 4973 | return 0; |
4974 | |||
4975 | err_cleanup: | ||
4976 | for_each_node_state(node, N_POSSIBLE) { | ||
4977 | if (!soft_limit_tree.rb_tree_per_node[node]) | ||
4978 | break; | ||
4979 | kfree(soft_limit_tree.rb_tree_per_node[node]); | ||
4980 | soft_limit_tree.rb_tree_per_node[node] = NULL; | ||
4981 | } | ||
4982 | return 1; | ||
4983 | |||
4974 | } | 4984 | } |
4975 | 4985 | ||
4976 | static struct cgroup_subsys_state * __ref | 4986 | static struct cgroup_subsys_state * __ref |