X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=mm%2Fmemcontrol.c;h=9ba67dd6db341c8097d7a7bdb9ef74918264d182;hp=204de6ab629273f70928b0eb863aee13be52f0e2;hb=0abb05a8cfd498a24ff4d290966e22fda3ee08e5;hpb=494fcf9f236d2ced8fede73189961526491db1dc diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 204de6ab6292..9ba67dd6db34 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4564,16 +4564,17 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp, swap_buffers: /* Swap primary and spare array */ thresholds->spare = thresholds->primary; - /* If all events are unregistered, free the spare array */ - if (!new) { - kfree(thresholds->spare); - thresholds->spare = NULL; - } rcu_assign_pointer(thresholds->primary, new); /* To be sure that nobody uses thresholds */ synchronize_rcu(); + + /* If all events are unregistered, free the spare array */ + if (!new) { + kfree(thresholds->spare); + thresholds->spare = NULL; + } unlock: mutex_unlock(&memcg->thresholds_lock); }