mirror of https://github.com/thesofproject/sof.git
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>
This commit is contained in:
parent
be0b058974
commit
0df634e8a9
|
@ -79,6 +79,7 @@ static inline void list_item_del(struct list_item *item)
|
||||||
{
|
{
|
||||||
item->next->prev = item->prev;
|
item->next->prev = item->prev;
|
||||||
item->prev->next = item->next;
|
item->prev->next = item->next;
|
||||||
|
list_init(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delete item from the list list iteam will be reinitialised
|
/* delete item from the list list iteam will be reinitialised
|
||||||
|
|
Loading…
Reference in New Issue