The unused RX I/O buffers are currently freed without being deleted
from the list, with the list head being reinitialised only after all
buffers have been deleted. This triggers assertion failures due to
the list integrity checks when debugging is enabled.
Fix by deleting each buffer individually, so that the list structure
remains valid at all times.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
virtnet_free_virtqueues ( netdev );
/* Free rx iobufs */
- list_for_each_entry_safe ( iobuf, next_iobuf, &virtnet->rx_iobufs, list ) {
+ list_for_each_entry_safe ( iobuf, next_iobuf, &virtnet->rx_iobufs,
+ list ) {
+ list_del ( &iobuf->list );
free_rx_iob ( iobuf );
}
- INIT_LIST_HEAD ( &virtnet->rx_iobufs );
virtnet->rx_num_iobufs = 0;
}