mirror of https://gitee.com/openkylin/linux.git
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:
parent
85689b24c5
commit
71bb0012c3
|
@ -903,6 +903,9 @@ int rhashtable_walk_init(struct rhashtable *ht, struct rhashtable_iter *iter)
|
|||
if (!iter->walker)
|
||||
return -ENOMEM;
|
||||
|
||||
INIT_LIST_HEAD(&iter->walker->list);
|
||||
iter->walker->resize = false;
|
||||
|
||||
mutex_lock(&ht->mutex);
|
||||
list_add(&iter->walker->list, &ht->walkers);
|
||||
mutex_unlock(&ht->mutex);
|
||||
|
|
Loading…
Reference in New Issue