uloop timer: update the timeout->next->prev when adding timeout to the list
authorFelix Fietkau <nbd@openwrt.org>
Mon, 11 Oct 2010 15:12:03 +0000 (17:12 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 11 Oct 2010 15:12:03 +0000 (17:12 +0200)
uloop.c

diff --git a/uloop.c b/uloop.c
index 8c85906d4ed4377f585d7dd79cf5df3aead41e05..da418b7168d2fe885779c647f29293e67d54013e 100644 (file)
--- a/uloop.c
+++ b/uloop.c
@@ -118,6 +118,8 @@ int uloop_timeout_add(struct uloop_timeout *timeout)
 
        timeout->prev = prev;
        timeout->next = *head;
+       if (timeout->next)
+               timeout->next->prev = timeout;
        *head = timeout;
        timeout->pending = true;