Skip to content
Snippets Groups Projects
Commit 0252ba26 authored by Timothy Arceri's avatar Timothy Arceri
Browse files

util: fix list_is_singular()


Currently its dependant on the user calling and checking the result
of list_empty() before using the result of list_is_singular().

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: default avatarJason Ekstrand <jason@jlekstrand.net>
parent 5857858a
No related branches found
No related tags found
No related merge requests found
......@@ -110,7 +110,7 @@ static inline bool list_empty(struct list_head *list)
*/
static inline bool list_is_singular(const struct list_head *list)
{
return list->next != NULL && list->next->next == list;
return list->next != NULL && list->next != list && list->next->next == list;
}
static inline unsigned list_length(struct list_head *list)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment