summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2015-01-21 12:12:13 +0100
committerDavid S. Miller <davem@davemloft.net>2015-01-26 09:08:23 +0100
commit607954b084d4ad5e6a2e0f795de7803d9c6ae37f (patch)
tree410712944738de9608e3c71476739fb7a008a667
parentnet/fsl: Replace spin_event_timeout() with arch independent in xgmac_mdio (diff)
downloadlinux-607954b084d4ad5e6a2e0f795de7803d9c6ae37f.tar.xz
linux-607954b084d4ad5e6a2e0f795de7803d9c6ae37f.zip
rhashtable: fix rht_for_each_entry_safe() endless loop
"next" is not updated, causing an endless loop for buckets with more than one element. Fixes: 88d6ed15acff ("rhashtable: Convert bucket iterators to take table and index") Signed-off-by: Patrick McHardy <kaber@trash.net> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/rhashtable.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
index a2562ed53ea3..e0337844358e 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