From 83de2fa53b22686dc07e00d46e7bc83d5046b919 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 19 Apr 2004 17:22:29 -0700 Subject: [PATCH] hlist_add_after() fix From: "Pedro Emanuel M. D. Pinto" This currently-unused function is incorrectly implemented. Fix. --- include/linux/list.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include/linux/list.h') diff --git a/include/linux/list.h b/include/linux/list.h index 34fd74e050df..9e0c971ded6f 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -610,9 +610,12 @@ static inline void hlist_add_before(struct hlist_node *n, static inline void hlist_add_after(struct hlist_node *n, struct hlist_node *next) { - next->next = n->next; - *(next->pprev) = n; - n->next = next; + next->next = n->next; + n->next = next; + next->pprev = &n->next; + + if(next->next) + next->next->pprev = &next->next; } #define hlist_entry(ptr, type, member) container_of(ptr,type,member) -- cgit v1.2.3