summaryrefslogtreecommitdiffstats
path: root/mm/slub.c
diff options
context:
space:
mode:
authorXiongwei Song <xiongwei.song@windriver.com>2023-04-13 16:34:48 +0200
committerVlastimil Babka <vbabka@suse.cz>2023-05-22 15:20:21 +0200
commit35973232b5cddd8b03dac2730cd1ca53137d1cd4 (patch)
treea186cde6f46a8ad09d81c06755c019c8478eaf00 /mm/slub.c
parentmm/slab: correct return values in comment for _kmem_cache_create() (diff)
downloadlinux-35973232b5cddd8b03dac2730cd1ca53137d1cd4.tar.xz
linux-35973232b5cddd8b03dac2730cd1ca53137d1cd4.zip
slub: Correct the error code when slab_kset is NULL
The -ENOSYS is inproper when kset_create_and_add call returns a NULL pointer, the failure more likely is because lacking memory, hence returning -ENOMEM is better. Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c
index c87628cd8a9a..1202ed1200f9 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -6224,7 +6224,7 @@ static int __init slab_sysfs_init(void)
if (!slab_kset) {
mutex_unlock(&slab_mutex);
pr_err("Cannot register slab subsystem.\n");
- return -ENOSYS;
+ return -ENOMEM;
}
slab_state = FULL;