linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ben Luo <luoben@linux.alibaba.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,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: luoben@linux.alibaba.com
Subject: [PATCH] mm/slub: return 0 when object pointer is NULL
Date: Mon, 12 Sep 2022 13:59:39 +0800	[thread overview]
Message-ID: <1662962379-16174-1-git-send-email-luoben@linux.alibaba.com> (raw)

NULL is definitly not a valid address

Signed-off-by: Ben Luo <luoben@linux.alibaba.com>
---
 mm/slub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/slub.c b/mm/slub.c
index 862dbd9..50fad18 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -674,7 +674,7 @@ static inline int check_valid_pointer(struct kmem_cache *s,
 	void *base;
 
 	if (!object)
-		return 1;
+		return 0;
 
 	base = slab_address(slab);
 	object = kasan_reset_tag(object);
-- 
1.8.3.1



             reply	other threads:[~2022-09-12  5:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12  5:59 Ben Luo [this message]
2022-09-12  7:18 ` [PATCH] mm/slub: return 0 when object pointer is NULL Hyeonggon Yoo
2022-09-12  7:29   ` Ben Luo
2022-09-12  7:47     ` Hyeonggon Yoo
2022-09-14  2:11 ` [mm/slub] fb670abe87: BUG_kmem_cache_node(Not_tainted):Freechain_corrupt kernel test robot

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=1662962379-16174-1-git-send-email-luoben@linux.alibaba.com \
    --to=luoben@linux.alibaba.com \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --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 \
    /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;
as well as URLs for NNTP newsgroup(s).