diff options
author | Mark Brown <broonie@kernel.org> | 2016-02-10 18:26:26 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-10 18:26:26 +0000 |
commit | b388b35a17d53dac58f2391795b823b7c5a54bac (patch) | |
tree | a8db4b571297771e191489abeede06514fe94fd3 /mm/memcontrol.c | |
parent | 6b4fe72f6c1ab93a893a8bc2e1155d34d7689440 (diff) | |
parent | 17aa01a7059b202f893a9e7e859032640318b458 (diff) |
Merge branch 'linaro-android-3.18-lsk' of git://android.git.linaro.org/kernel/linaro-android into linux-linaro-lsk-v3.18-androidlsk-v3.18-16.02-android
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index ee15ae6e698f..6a548f8b3f49 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4748,16 +4748,17 @@ static void __mem_cgroup_usage_unregister_event(struct mem_cgroup *memcg, 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); } |