diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-01-14 23:49:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-14 23:49:22 -0500 |
commit | 06e9d9f9783860fe4c602ef491f47211804ccc96 (patch) | |
tree | a2adab8ab7690984b11e7fdc757f91587c380d51 | |
parent | 27c915a4d843b90eb4065298969578d15e5e6ab0 (diff) |
netxen: cleanup mac list on driver unload
This fixes a tiny memory leak when driver is unloaded. The mac
address list maintained in netxen_adapter needs to deleted when
driver is going down.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 1 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 13 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 3 |
3 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index a674a23f72b4..6598a34b87d4 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -1478,6 +1478,7 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter); | |||
1478 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); | 1478 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); |
1479 | void netxen_p2_nic_set_multi(struct net_device *netdev); | 1479 | void netxen_p2_nic_set_multi(struct net_device *netdev); |
1480 | void netxen_p3_nic_set_multi(struct net_device *netdev); | 1480 | void netxen_p3_nic_set_multi(struct net_device *netdev); |
1481 | void netxen_p3_free_mac_list(struct netxen_adapter *adapter); | ||
1481 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32); | 1482 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32); |
1482 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); | 1483 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); |
1483 | 1484 | ||
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 511db2ac57c9..e2d2a2fdbe19 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -627,6 +627,19 @@ int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) | |||
627 | (struct cmd_desc_type0 *)&req, 1); | 627 | (struct cmd_desc_type0 *)&req, 1); |
628 | } | 628 | } |
629 | 629 | ||
630 | void netxen_p3_free_mac_list(struct netxen_adapter *adapter) | ||
631 | { | ||
632 | nx_mac_list_t *cur, *next; | ||
633 | |||
634 | cur = adapter->mac_list; | ||
635 | |||
636 | while (cur) { | ||
637 | next = cur->next; | ||
638 | kfree(cur); | ||
639 | cur = next; | ||
640 | } | ||
641 | } | ||
642 | |||
630 | #define NETXEN_CONFIG_INTR_COALESCE 3 | 643 | #define NETXEN_CONFIG_INTR_COALESCE 3 |
631 | 644 | ||
632 | /* | 645 | /* |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index cbe2b3e814dd..9268fd2fbacf 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -986,6 +986,9 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
986 | netxen_free_hw_resources(adapter); | 986 | netxen_free_hw_resources(adapter); |
987 | netxen_release_rx_buffers(adapter); | 987 | netxen_release_rx_buffers(adapter); |
988 | netxen_free_sw_resources(adapter); | 988 | netxen_free_sw_resources(adapter); |
989 | |||
990 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | ||
991 | netxen_p3_free_mac_list(adapter); | ||
989 | } | 992 | } |
990 | 993 | ||
991 | if (adapter->portnum == 0) | 994 | if (adapter->portnum == 0) |