[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1421838733-16495-1-git-send-email-kaber@trash.net>
Date: Wed, 21 Jan 2015 11:12:13 +0000
From: Patrick McHardy <kaber@...sh.net>
To: tgraf@...g.ch
Cc: davem@...emloft.net, netdev@...r.kernel.org,
Patrick McHardy <kaber@...sh.net>
Subject: [PATCH] rhashtable: fix rht_for_each_entry_safe() endless loop
"next" is not updated, causing an endless loop for buckets with more than
one element.
Signed-off-by: Patrick McHardy <kaber@...sh.net>
---
include/linux/rhashtable.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
index 9570832..83944f9 100644
--- a/include/linux/rhashtable.h
+++ b/include/linux/rhashtable.h
@@ -260,7 +260,9 @@ void rhashtable_destroy(struct rhashtable *ht);
next = !rht_is_a_nulls(pos) ? \
rht_dereference_bucket(pos->next, tbl, hash) : NULL; \
(!rht_is_a_nulls(pos)) && rht_entry(tpos, pos, member); \
- pos = next)
+ pos = next, \
+ next = !rht_is_a_nulls(pos) ? \
+ rht_dereference_bucket(pos->next, tbl, hash) : NULL)
/**
* rht_for_each_rcu_continue - continue iterating over rcu hash chain
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists