[PATCH resend] rhashtable: initialize all rhashtable walker members

Subsystems: library code, rhashtable, the rest · Maintainers: Andrew Morton, Thomas Graf, Herbert Xu, Linus Torvalds

STALE4263d

2 messages, 2 authors, 2015-02-23 · open the first message on its own page

[PATCH resend] rhashtable: initialize all rhashtable walker members

From: Sasha Levin <hidden>
Date: 2015-02-23 09:36:20

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 <redacted>
---
 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

Re: [PATCH resend] rhashtable: initialize all rhashtable walker members

From: David Miller <davem@davemloft.net>
Date: 2015-02-23 20:23:59

From: Sasha Levin <redacted>
Date: Mon, 23 Feb 2015 04:35:06 -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 <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help