From 886e2ae698fb8908fff67dba4b47beb1514e55c3 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 15bb266002b5..163bd5c8f979 100644 --- a/src/include/sof/list.h +++ b/src/include/sof/list.h @@ -77,6 +77,7 @@ static inline void list_item_del(struct list_item *item) { item->next->prev = item->prev; item->prev->next = item->next; + list_init(item); } /* is list item the last item in list ? */