Skip to content

Commit

Permalink
rhashtable: fix rht_for_each_entry_safe() endless loop
Browse files Browse the repository at this point in the history
"next" is not updated, causing an endless loop for buckets with more than
one element.

Fixes: 88d6ed1 ("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>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jan 26, 2015
1 parent 22f6bba commit 607954b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/linux/rhashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 607954b

Please sign in to comment.