X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=mm%2Fslab_common.c;h=5ce4faeb16fbbdfa19b16c3d551aace8c3a495c0;hb=8f697e574012cc73b6b0dcbf30d88a3a0f43b78f;hp=c26829fe4e37ea0b38ce6c26fef84a7dcb528eee;hpb=425afcff13a4bea2a3cf6f395cbc66fc158852be;p=firefly-linux-kernel-4.4.55.git diff --git a/mm/slab_common.c b/mm/slab_common.c index c26829fe4e37..5ce4faeb16fb 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -500,7 +500,7 @@ void memcg_create_kmem_cache(struct mem_cgroup *memcg, struct kmem_cache *root_cache) { static char memcg_name_buf[NAME_MAX + 1]; /* protected by slab_mutex */ - struct cgroup_subsys_state *css = mem_cgroup_css(memcg); + struct cgroup_subsys_state *css = &memcg->css; struct memcg_cache_array *arr; struct kmem_cache *s = NULL; char *cache_name; @@ -640,6 +640,9 @@ void kmem_cache_destroy(struct kmem_cache *s) bool need_rcu_barrier = false; bool busy = false; + if (unlikely(!s)) + return; + BUG_ON(!is_root_cache(s)); get_online_cpus();