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(