rhashtable: initialize all rhashtable walker members
Commitf2dba9c6ff("rhashtable: Introduce rhashtable_walk_*") forgot to initialize the members of struct rhashtable_walker after allocating it, which caused an undefined value for 'resize' which is used later on. Fixes:f2dba9c6ff("rhashtable: Introduce rhashtable_walk_*") Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
85689b24c5
commit
71bb0012c3
@@ -903,6 +903,9 @@ int rhashtable_walk_init(struct rhashtable *ht, struct rhashtable_iter *iter)
|
|||||||
if (!iter->walker)
|
if (!iter->walker)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
INIT_LIST_HEAD(&iter->walker->list);
|
||||||
|
iter->walker->resize = false;
|
||||||
|
|
||||||
mutex_lock(&ht->mutex);
|
mutex_lock(&ht->mutex);
|
||||||
list_add(&iter->walker->list, &ht->walkers);
|
list_add(&iter->walker->list, &ht->walkers);
|
||||||
mutex_unlock(&ht->mutex);
|
mutex_unlock(&ht->mutex);
|
||||||
|
|||||||
Reference in New Issue
Block a user