Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8110>
*/
static inline bool list_is_singular(const struct list_head *list)
{
- return list_is_linked(list) && list->next != list && list->next->next == list;
+ return list_is_linked(list) && !list_is_empty(list) && list->next->next == list;
}
static inline unsigned list_length(const struct list_head *list)