This loop was always exited in the first iteration by `return`.
{
struct tls_keys_ref *ref = getnext;
- while (1) {
+ /* Get next list entry. */
+ ref = LIST_NEXT(&ref->list, struct tls_keys_ref *, list);
- /* Get next list entry. */
- ref = LIST_NEXT(&ref->list, struct tls_keys_ref *, list);
-
- /* If the entry is the last of the list, return NULL. */
- if (&ref->list == end)
- return NULL;
+ /* If the entry is the last of the list, return NULL. */
+ if (&ref->list == end)
+ return NULL;
- return ref;
- }
+ return ref;
}
static inline