Skip to content

Commit 3beb2fb

Browse files
Yan Zhentehcaster
authored andcommitted
mm, slab: use kmem_cache_free() to free from kmem_buckets_cache
In kmem_buckets_create(), the kmem_buckets object is allocated by kmem_cache_alloc() from kmem_buckets_cache, but in the failure case, it's freed by kfree(). This is not wrong, but using kmem_cache_free() is the more common pattern, so use it. Signed-off-by: Yan Zhen <[email protected]> Reviewed-by: Christoph Lameter <[email protected]> Signed-off-by: Vlastimil Babka <[email protected]>
1 parent 1941b31 commit 3beb2fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/slab_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ kmem_buckets *kmem_buckets_create(const char *name, slab_flags_t flags,
495495
fail:
496496
for (idx = 0; idx < ARRAY_SIZE(kmalloc_caches[KMALLOC_NORMAL]); idx++)
497497
kmem_cache_destroy((*b)[idx]);
498-
kfree(b);
498+
kmem_cache_free(kmem_buckets_cache, b);
499499

500500
return NULL;
501501
}

0 commit comments

Comments
 (0)