From d1a8c9e1c8a49afccc85dfeccd731ccbec52e724 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Tue, 31 Mar 2009 20:38:19 +0000 Subject: [PATCH] igb: set num_rx/tx_queues to 0 when queues are freed An issue was seen on suspend in which the system reported a page fault. This was due to the new reg_idx code being called after the queues were freed. This update prevents any for loops from going through the queues by setting the number of queues to 0 when they are freed. Signed-off-by: Alexander Duyck Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller --- drivers/net/igb/igb_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index be02045a507..10b095d69b4 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c @@ -420,6 +420,9 @@ static void igb_free_queues(struct igb_adapter *adapter) for (i = 0; i < adapter->num_rx_queues; i++) netif_napi_del(&adapter->rx_ring[i].napi); + adapter->num_rx_queues = 0; + adapter->num_tx_queues = 0; + kfree(adapter->tx_ring); kfree(adapter->rx_ring); } -- 2.41.1