]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - mm/memcontrol.c
Merge tag 'ktest-fix-make-min-failed-build-for-real' of git://git.kernel.org/pub...
[mv-sheeva.git] / mm / memcontrol.c
index 6728a7ae6f2d1eb42c8ac183ec69098aa80d2d6c..228d6461c12ade8941b37416ca867d3df3277acd 100644 (file)
@@ -4414,6 +4414,9 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
         */
        BUG_ON(!thresholds);
 
+       if (!thresholds->primary)
+               goto unlock;
+
        usage = mem_cgroup_usage(memcg, type == _MEMSWAP);
 
        /* Check if a threshold crossed before removing */
@@ -4462,7 +4465,7 @@ swap_buffers:
 
        /* To be sure that nobody uses thresholds */
        synchronize_rcu();
-
+unlock:
        mutex_unlock(&memcg->thresholds_lock);
 }