slub: return actual error on sysfs functions
Subsystems (2)
PATCH 3/24 slub: return actual error on sysfs functions
From: Jie Liu <[email protected]>
Return the actual error code if call kset_create_and_add() failed
Cc Christoph Lameter <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc Matt Mackall <[email protected]>
Cc Andrew Morton <[email protected]>
Signed-off-by Jie Liu <[email protected]>
--- mm/slub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
mm/slub.c +4 -4
@@ -5215,8 +5215,8 @@ static int sysfs_slab_add(struct kmem_cache *s)#ifdef CONFIG_MEMCG_KMEM if (is_root_cache (s)) { s->memcg_kset =kset_create_and_add ("cgroup" ,NULL , &s->kobj); -if (!s->memcg_kset) { - err = -ENOMEM ; +if (IS_ERR (s->memcg_kset)) { + err =PTR_ERR (s->memcg_kset); goto out_del_kobj; } }
@@ -5298,10 +5298,10 @@ static int __init slab_sysfs_init(void)mutex_lock (&slab_mutex); slab_kset =kset_create_and_add ("slab" , &slab_uevent_ops, kernel_kobj); -if (!slab_kset) { +if (IS_ERR (slab_kset)) {mutex_unlock (&slab_mutex);pr_err ("Cannot register slab subsystem.\n" ); -return -ENOSYS ; +return PTR_ERR (slab_kset); } slab_state =FULL ;
Signature · 7 lines
1.8.3.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 1 line · Jeff Liu
Return the actual error code if call
kset_create_and_add()failed
This all looks fine to me aside from the patch sequencing issues mentioned by others.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>