linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: sxwjean@me.com
To: cl@linux.com, penberg@kernel.org, rientjes@google.com,
	iamjoonsoo.kim@lge.com, akpm@linux-foundation.org,
	vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com,
	keescook@chromium.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org,
	Xiongwei Song <xiongwei.song@windriver.com>
Subject: [PATCH 1/5] slub: Correct the error code when slab_kset is NULL
Date: Thu, 13 Apr 2023 22:34:48 +0800	[thread overview]
Message-ID: <20230413143452.211250-2-sxwjean@me.com> (raw)
In-Reply-To: <20230413143452.211250-1-sxwjean@me.com>

From: Xiongwei Song <xiongwei.song@windriver.com>

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>
---
 mm/slub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index 28ca576d988d..5cc56f780241 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -6225,7 +6225,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;
-- 
2.30.2



  reply	other threads:[~2023-04-13 14:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 14:34 [PATCH 0/5] Some tiny clean ups for SLUB sxwjean
2023-04-13 14:34 ` sxwjean [this message]
2023-04-13 14:34 ` [PATCH 2/5] slub: Put objects_show() into CONFIG_SLUB_DEBUG enabled block sxwjean
2023-04-13 17:53   ` kernel test robot
2023-04-17  7:12     ` Song, Xiongwei
2023-04-13 14:34 ` [PATCH 3/5] slub: Remove CONFIG_SMP defined check sxwjean
2023-04-13 14:34 ` [PATCH 4/5] slub: Remove slabs_node() function sxwjean
2023-04-13 14:34 ` [PATCH 5/5] slub: Don't read nr_slabs and total_objects directly sxwjean
2023-04-18  7:50 ` [PATCH 0/5] Some tiny clean ups for SLUB Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230413143452.211250-2-sxwjean@me.com \
    --to=sxwjean@me.com \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=roman.gushchin@linux.dev \
    --cc=vbabka@suse.cz \
    --cc=xiongwei.song@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox