From: Sasha Levin Date: Mon, 23 Feb 2015 09:35:06 +0000 (-0500) Subject: rhashtable: initialize all rhashtable walker members X-Git-Tag: v4.9.8~4698^2~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71bb0012c38fbd090a56b3cb96e9f626c415d264;p=platform%2Fkernel%2Flinux-rpi3.git rhashtable: initialize all rhashtable walker members 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 Signed-off-by: David S. Miller --- diff --git a/lib/rhashtable.c b/lib/rhashtable.c index b41a5c0..e3a04e4 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c @@ -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);