summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-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)