linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/slub: return 0 when object pointer is NULL
@ 2022-09-12  5:59 Ben Luo
  2022-09-12  7:18 ` Hyeonggon Yoo
  2022-09-14  2:11 ` [mm/slub] fb670abe87: BUG_kmem_cache_node(Not_tainted):Freechain_corrupt kernel test robot
  0 siblings, 2 replies; 5+ messages in thread
From: Ben Luo @ 2022-09-12  5:59 UTC (permalink / raw)
  To: cl, penberg, rientjes, iamjoonsoo.kim, akpm, vbabka,
	roman.gushchin, 42.hyeyoo, linux-mm, linux-kernel
  Cc: luoben

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



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

end of thread, other threads:[~2022-09-14  2:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-12  5:59 [PATCH] mm/slub: return 0 when object pointer is NULL Ben Luo
2022-09-12  7:18 ` 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

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).