From 0df634e8a987feb50699a77c7050c1d0985a8cad Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Mon, 3 Sep 2018 17:02:09 +0800 Subject: [PATCH] list: refine list_item_del to avoid make list chaos There are possible that we call list_item_del to same list item twice. This will cause the list be into chaos. Reset the next and prev pointer to 0 to avoid risk. Signed-off-by: Pan Xiuli --- src/include/sof/list.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/include/sof/list.h b/src/include/sof/list.h index 3174377ee..e91309cb3 100644 --- a/src/include/sof/list.h +++ b/src/include/sof/list.h @@ -79,6 +79,7 @@ static inline void list_item_del(struct list_item *item) { item->next->prev = item->prev; item->prev->next = item->next; + list_init(item); } /* delete item from the list list iteam will be reinitialised