X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=mm%2Fslab_common.c;h=5190a7cd02bda88a3df30b4f53166cf72ad74374;hb=7c9adf5a5471647f392169ef19d3e81dcfa76045;hp=fe8dc943c285c5b3627fd9fc331cb504f552eb9f;hpb=686d550d222e8f83f6e709debbedf9d8ef77aec7;p=firefly-linux-kernel-4.4.55.git diff --git a/mm/slab_common.c b/mm/slab_common.c index fe8dc943c285..5190a7cd02bd 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -111,6 +111,13 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align if (!s) err = -ENOSYS; /* Until __kmem_cache_create returns code */ + /* + * Check if the slab has actually been created and if it was a + * real instatiation. Aliases do not belong on the list + */ + if (s && s->refcount == 1) + list_add(&s->list, &slab_caches); + out_locked: mutex_unlock(&slab_mutex); put_online_cpus();