Skip to content

Commit 0df634e

Browse files
committed
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 <xiuli.pan@linux.intel.com>
1 parent be0b058 commit 0df634e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/include/sof/list.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ static inline void list_item_del(struct list_item *item)
7979
{
8080
item->next->prev = item->prev;
8181
item->prev->next = item->next;
82+
list_init(item);
8283
}
8384

8485
/* delete item from the list list iteam will be reinitialised

0 commit comments

Comments
 (0)