PM / sleep: Fix memory leak in pm_vt_switch_unregister().
[firefly-linux-kernel-4.4.55.git] / mm / slab_common.c
index a3443278ce3a693b4c2625df3752a59e975abca3..0b7bb399b0e46af8ac8b96fbedb67aef413e5cb7 100644 (file)
@@ -56,6 +56,7 @@ static int kmem_cache_sanity_check(struct mem_cgroup *memcg, const char *name,
                        continue;
                }
 
+#if !defined(CONFIG_SLUB) || !defined(CONFIG_SLUB_DEBUG_ON)
                /*
                 * For simplicity, we won't check this in the list of memcg
                 * caches. We have control over memcg naming, and if there
@@ -69,6 +70,7 @@ static int kmem_cache_sanity_check(struct mem_cgroup *memcg, const char *name,
                        s = NULL;
                        return -EINVAL;
                }
+#endif
        }
 
        WARN_ON(strchr(name, ' '));     /* It confuses parsers */
@@ -569,7 +571,7 @@ memcg_accumulate_slabinfo(struct kmem_cache *s, struct slabinfo *info)
                return;
 
        for_each_memcg_cache_index(i) {
-               c = cache_from_memcg(s, i);
+               c = cache_from_memcg_idx(s, i);
                if (!c)
                        continue;