llist: Make llist_del_first return only the first node
PATCH 1/1 llist: Make llist_del_first return only the first node
Set the next of the returned node of llist_del_first to NULL, which can prevent subsequent nodes in llist from being exposed, and is more consistent with the logic of this interface.
Signed-off-by liqiang <[email protected]>
--- lib/llist.c | 1 + 1 file changed, 1 insertion(+)
lib/llist.c +1 -0
@@ -61,6 +61,7 @@ struct llist_node *llist_del_first(struct llist_head *head) next =READ_ONCE (entry->next); }while (!try_cmpxchg (&head->first, &entry, next)); + entry->next =NULL ;return entry; }EXPORT_SYMBOL_GPL (llist_del_first);
Signature · 1 line
2.23.0.windows.1