Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 607954b0 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

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: 88d6ed15 ("rhashtable: Convert bucket iterators to take table and index")
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Acked-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 22f6bba7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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