--- linux-2.6.18-rc4/drivers/net/e1000/e1000_main.c.irsrs 2006-08-18 16:58:51.000000000 +0400 +++ linux-2.6.18-rc4/drivers/net/e1000/e1000_main.c 2006-08-19 22:54:00.000000000 +0400 @@ -1381,10 +1381,6 @@ setup_tx_desc_die: * (Descriptors) for all queues * @adapter: board private structure * - * If this function returns with an error, then it's possible one or - * more of the rings is populated (while the rest are not). It is the - * callers duty to clean those orphaned rings. - * * Return 0 on success, negative on failure **/ @@ -1398,6 +1394,9 @@ e1000_setup_all_tx_resources(struct e100 if (err) { DPRINTK(PROBE, ERR, "Allocation for Tx Queue %u failed\n", i); + for (i-- ; i >= 0; i--) + e1000_free_tx_resources(adapter, + &adapter->tx_ring[i]); break; } } @@ -1639,10 +1638,6 @@ setup_rx_desc_die: * (Descriptors) for all queues * @adapter: board private structure * - * If this function returns with an error, then it's possible one or - * more of the rings is populated (while the rest are not). It is the - * callers duty to clean those orphaned rings. - * * Return 0 on success, negative on failure **/ @@ -1656,6 +1651,9 @@ e1000_setup_all_rx_resources(struct e100 if (err) { DPRINTK(PROBE, ERR, "Allocation for Rx Queue %u failed\n", i); + for (i-- ; i >= 0; i--) + e1000_free_rx_resources(adapter, + &adapter->rx_ring[i]); break; } }