From 8c8be7e80dba8ddbe69e9eea6c19e9be85b32a06 Mon Sep 17 00:00:00 2001 From: Suraj Sonawane Date: Sat, 9 Nov 2024 19:58:28 +0530 Subject: [PATCH v2] KMSAN: fix uninit-value in bch2_copygc syz test Signed-off-by: Suraj Sonawane --- include/linux/rhashtable.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h index 9cc18d304..cb85ffe7b 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h @@ -373,7 +373,11 @@ static inline struct rhash_head *__rht_ptr( static inline struct rhash_head *rht_ptr_rcu( struct rhash_lock_head __rcu *const *bkt) { - return __rht_ptr(rcu_dereference(*bkt), bkt); + struct rhash_lock_head *ptr = rcu_dereference(*bkt); + if (!ptr) { + return NULL; + } + return __rht_ptr(ptr, bkt); } static inline struct rhash_head *rht_ptr( -- 2.34.1