[PATCH 2/3] mm/slub: use kmem_cache_alloc() in bootstrap()

From: Sang-Heon Jeon

Date: Tue Dec 01 2026 - 11:53:37 EST


bootstrap() allocates a kmem_cache with kmem_cache_zalloc(), which
returns zero-initialized memory. memcpy() then overwrites the whole
object, and nothing uses it in between.

So allocate it with kmem_cache_alloc() instead.

No functional change.

Signed-off-by: Sang-Heon Jeon <ekffu200098@xxxxxxxxx>
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index e966a0de1515..8e6e900fc39b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -8671,7 +8671,7 @@ static int slab_memory_callback(struct notifier_block *self,
static struct kmem_cache * __init bootstrap(struct kmem_cache *static_cache)
{
int node;
- struct kmem_cache *s = kmem_cache_zalloc(kmem_cache, GFP_NOWAIT);
+ struct kmem_cache *s = kmem_cache_alloc(kmem_cache, GFP_NOWAIT);
struct kmem_cache_node *n;

memcpy(s, static_cache, kmem_cache->object_size);
--
2.53.0