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>
This commit is contained in:
Xiongwei Song 2023-04-13 22:34:48 +08:00 committed by Vlastimil Babka
parent 444f20c29e
commit 35973232b5
1 changed files with 1 additions and 1 deletions

View File

@ -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;