Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 2699

kernel-2.6.18-238.el5.src.rpm

From: Andy Gospodarek <gospo@redhat.com>
Date: Tue, 12 May 2009 14:11:51 -0400
Subject: [net] igb: correctly free multiqueue netdevs
Message-id: 20090512181150.GT26634@gospo.rdu.redhat.com
O-Subject: [RHEL5.4 PATCH] igb: correctly free multiqueue netdevs
Bugzilla: 500446
RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
RH-Acked-by: Jiri Pirko <jpirko@redhat.com>
RH-Acked-by: Neil Horman <nhorman@redhat.com>

When doing some testing with a debug kernel Don discovered a panic when
unloading the igb driver.  I took a look and found the multiqueue
netdevs were being incorrectly freed.  Since they were being allocated
with alloc_netdev they need to be freed with free_netdev.

I tested this patch and the panic was no longer seen with the debug
kernel.

This will resolve RHBZ 500446.

diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index eb09613..a810e61 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -285,7 +285,7 @@ static void igb_free_queues(struct igb_adapter *adapter)
 	for (i = 0; i < adapter->num_rx_queues; i++) {
 		struct igb_ring *ring = &(adapter->rx_ring[i]);
 		ring->count = adapter->rx_ring_count;
-		kfree(ring->netdev);
+		free_netdev(ring->netdev);
 	}
 
 	adapter->num_rx_queues = 0;