diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 7081c1214e6c..218994cd76fc 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -1357,6 +1357,9 @@ static void *__cache_seq_start(struct seq_file *m, loff_t *pos) hlist_first_rcu(&cd->hash_table[hash])), struct cache_head, cache_list); + if (hash >= cd->hash_size) + return NULL; + *pos = ((long long)hash << 32) + 1; return ch; }