netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rhashtable: initialize all rhashtable walker members
@ 2015-02-21 20:55 Sasha Levin
  2015-02-22 20:58 ` David Miller
  2015-02-22 21:10 ` Daniel Borkmann
  0 siblings, 2 replies; 5+ messages in thread
From: Sasha Levin @ 2015-02-21 20:55 UTC (permalink / raw)
  To: herbert, tgraf; +Cc: netdev, linux-kernel, Sasha Levin

Commit "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.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 lib/rhashtable.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 9cc4c4a..030484c 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -894,6 +894,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);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-02-22 21:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-21 20:55 [PATCH] rhashtable: initialize all rhashtable walker members Sasha Levin
2015-02-22 20:58 ` David Miller
2015-02-22 21:28   ` Sasha Levin
2015-02-22 21:29     ` David Miller
2015-02-22 21:10 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).