diff options
author | Yan Zhen <yanzhen@vivo.com> | 2024-08-22 05:27:04 +0300 |
---|---|---|
committer | Vlastimil Babka <vbabka@suse.cz> | 2024-08-27 17:57:35 +0300 |
commit | 3beb2fb68184fda063cdd3cdd3bbe52c5cae56bb (patch) | |
tree | 8b621c004c218142cff9fb02e25fd8912608dfcf /mm | |
parent | 1941b31482a61a7bd75300d1905938e7e48c3d25 (diff) | |
download | linux-3beb2fb68184fda063cdd3cdd3bbe52c5cae56bb.tar.xz |
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 <yanzhen@vivo.com>
Reviewed-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index dea2b05c0e3f..ca694f5553b4 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -495,7 +495,7 @@ kmem_buckets *kmem_buckets_create(const char *name, slab_flags_t flags, fail: for (idx = 0; idx < ARRAY_SIZE(kmalloc_caches[KMALLOC_NORMAL]); idx++) kmem_cache_destroy((*b)[idx]); - kfree(b); + kmem_cache_free(kmem_buckets_cache, b); return NULL; } |