linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 03/24] slub: return actual error on sysfs functions
@ 2014-06-17 14:28 Jeff Liu
  2014-06-17 15:52 ` Christoph Lameter
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Liu @ 2014-06-17 14:28 UTC (permalink / raw)
  To: Christoph Lameter; +Cc: Andrew Morton, Pekka Enberg, Matt Mackall, linux-mm

From: Jie Liu <jeff.liu@oracle.com>

Return the actual error code if call kset_create_and_add() failed

Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Matt Mackall <mpm@selenic.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
---
 mm/slub.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index b2b0473..fc9f5bc 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -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;
-- 
1.8.3.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-17 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-17 14:28 [PATCH 03/24] slub: return actual error on sysfs functions Jeff Liu
2014-06-17 15:52 ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox