summaryrefslogtreecommitdiff
path: root/include/linux/list.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-19 17:22:29 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-19 17:22:29 -0700
commit83de2fa53b22686dc07e00d46e7bc83d5046b919 (patch)
tree7d8a46c893f4ec1964e68bd17374074b9dc13773 /include/linux/list.h
parent717a2c9cb13e078b75cc34489775c173d3a2920b (diff)
[PATCH] hlist_add_after() fix
From: "Pedro Emanuel M. D. Pinto" <pepinto@student.dei.uc.pt> This currently-unused function is incorrectly implemented. Fix.
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h9
1 files changed, 6 insertions, 3 deletions
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)