mirror of
https://github.com/ipxe/ipxe.git
synced 2026-05-04 12:01:25 +02:00
[virtio] Fix assertion failures when interface is closed
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>
This commit is contained in:
parent
2b2580f78f
commit
1c54e7e8a4
@ -338,10 +338,11 @@ static void virtnet_close ( struct net_device *netdev ) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user