]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
rhashtable: initialize all rhashtable walker members
authorSasha Levin <sasha.levin@oracle.com>
Mon, 23 Feb 2015 09:35:06 +0000 (04:35 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Feb 2015 20:23:19 +0000 (15:23 -0500)
Commit f2dba9c6ff ("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>
lib/rhashtable.c

index b41a5c09832a364462e2053faf32892a5b0b3daa..e3a04e4b3ec56a6dd203bf80bb75c4cfde3e2d74 100644 (file)
@@ -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);