RE: Segfault hidden in list.h

From: Davide Libenzi (davidel@xmailserver.org)
Date: Sun May 12 2002 - 20:34:53 EST


On Sun, 12 May 2002, Rose, Billy wrote:

> The code inside of __list_add:
>
> next->prev = new;
> new->next = next;
> new->prev = prev;
> pre-next = new;
>
> needs to be altered to:
>
> new->prev = prev;
> new->next = next;
> next->prev = new;
> prev->next = new;

you need a wmb also :

new->prev = prev;
new->next = next;
wmb
next->prev = new;
prev->next = new;

- Davide

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue May 14 2002 - 12:00:19 EST