llist_entry(NULL) must not return NULL, it needs to wrap around
and return NULL minus the offset.
the iterators stop when the offset added back to the result of
llist_entry() is NULL
they test that the first node is not NULL or that the next pointer
stored in a previous iteration of the loop is not NULL
OpenBSD commit: https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/dev/pci/drm/include/linux/llist.h?rev=1.3&content-type=text/x-cvsweb-markup
Reported by: jsg@OpenBSD.org
Sponsored by: Beckhoff Automation GmbH & Co. KG