mirror of
https://github.com/ipxe/ipxe
synced 2026-07-01 00:04:54 +03:00
[aqc1xx] Free outstanding receive I/O buffers on close
atl_close() freed the descriptor rings but left the posted receive I/O buffers allocated, leaking them and tripping an assertion on the next open. Free any outstanding receive I/O buffers in atl_close(). Signed-off-by: Animesh Bhatt <animeshb@marvell.com>
This commit is contained in:
committed by
Michael Brown
parent
56347b2612
commit
449d2acf3d
@@ -262,6 +262,7 @@ err_tx_alloc:
|
|||||||
*/
|
*/
|
||||||
static void atl_close ( struct net_device *netdev ) {
|
static void atl_close ( struct net_device *netdev ) {
|
||||||
struct atl_nic *nic = netdev->priv;
|
struct atl_nic *nic = netdev->priv;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
nic->hw_ops->stop ( nic );
|
nic->hw_ops->stop ( nic );
|
||||||
/* rpb global ctrl */
|
/* rpb global ctrl */
|
||||||
@@ -282,6 +283,13 @@ static void atl_close ( struct net_device *netdev ) {
|
|||||||
|
|
||||||
atl_ring_free ( &nic->tx_ring );
|
atl_ring_free ( &nic->tx_ring );
|
||||||
atl_ring_free ( &nic->rx_ring );
|
atl_ring_free ( &nic->rx_ring );
|
||||||
|
|
||||||
|
/* Discard any outstanding receive I/O buffers */
|
||||||
|
for ( i = 0 ; i < ATL_RING_SIZE ; i++ ) {
|
||||||
|
if ( nic->iobufs[i] )
|
||||||
|
free_rx_iob ( nic->iobufs[i] );
|
||||||
|
nic->iobufs[i] = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user