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:
Pan Xiuli 2018-09-03 17:02:09 +08:00
parent be0b058974
commit 0df634e8a9
1 changed files with 1 additions and 0 deletions

View File

@ -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