X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2Fllist.c;h=ae5872b1df0c669fc8365ce1754d2a128651a890;hb=c35c7ac5da8ddfd7c6cd1acc29b052a15f437e24;hp=0b0e9779d6753b1a3982551afdbb685e0b6a209e;hpb=e9e4e44309f866b115d08ab4a54834008c50a8a4;p=firefly-linux-kernel-4.4.55.git diff --git a/lib/llist.c b/lib/llist.c index 0b0e9779d675..ae5872b1df0c 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -66,12 +66,12 @@ struct llist_node *llist_del_first(struct llist_head *head) { struct llist_node *entry, *old_entry, *next; - entry = head->first; + entry = smp_load_acquire(&head->first); for (;;) { if (entry == NULL) return NULL; old_entry = entry; - next = entry->next; + next = READ_ONCE(entry->next); entry = cmpxchg(&head->first, old_entry, next); if (entry == old_entry) break;