Skip to content

Commit 886e2ae

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 7346243 commit 886e2ae

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
@@ -77,6 +77,7 @@ static inline void list_item_del(struct list_item *item)
7777
{
7878
item->next->prev = item->prev;
7979
item->prev->next = item->next;
80+
list_init(item);
8081
}
8182

8283
/* is list item the last item in list ? */

0 commit comments

Comments
 (0)