From 7370257aa9f1ca21cc0219e10cd6884f8475357c Mon Sep 17 00:00:00 2001 From: Suraj Sonawane Date: Sun, 10 Nov 2024 11:15:14 +0530 Subject: [PATCH v4] KMSAN: fix uninit-value in bch2_copygc syz test Signed-off-by: Suraj Sonawane --- include/linux/rhashtable.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h index 8463a128e..0414a856f 100644 --- a/include/linux/rhashtable.h +++ b/include/linux/rhashtable.h @@ -373,7 +373,13 @@ 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) { + ptr = 0; + } + + return __rht_ptr(ptr, bkt); } static inline struct rhash_head *rht_ptr( -- 2.34.1