diff --git a/mm/slab.c b/mm/slab.c index db0db44798c265..328233a724afb6 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2118,9 +2118,15 @@ __kmem_cache_alias(const char *name, size_t size, size_t align, struct kmem_cache *cachep; cachep = find_mergeable(size, align, flags, name, ctor); - if (cachep) + if (cachep) { cachep->refcount++; + /* + * Adjust the object sizes so that we clear + * the complete object on kzalloc. + */ + cachep->object_size = max_t(int, cachep->object_size, size); + } return cachep; }