lkml.org 
[lkml]   [2022]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/slub: return 0 when object pointer is NULL
Date
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
\
 
 \ /
  Last update: 2022-09-12 08:00    [W:0.098 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site