Skip to content

Commit

Permalink
rhashtable: initialize all rhashtable walker members
Browse files Browse the repository at this point in the history
Commit f2dba9c ("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: f2dba9c ("rhashtable: Introduce rhashtable_walk_*")
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sasha Levin authored and David S. Miller committed Feb 23, 2015
1 parent 85689b2 commit 71bb001
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rhashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 71bb001

Please sign in to comment.