Skip to content

Commit

Permalink
cxgb4: free mac_hlist properly
Browse files Browse the repository at this point in the history
The locally maintained list for tracking hash mac table was
not freed during driver remove.

Signed-off-by: Arjun Vynipadath <[email protected]>
Signed-off-by: Ganesh Goudar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
arjunvynipadath authored and davem330 committed Nov 9, 2018
1 parent e6e8869 commit 2a8d84b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2295,6 +2295,8 @@ static int cxgb_up(struct adapter *adap)

static void cxgb_down(struct adapter *adapter)
{
struct hash_mac_addr *entry, *tmp;

cancel_work_sync(&adapter->tid_release_task);
cancel_work_sync(&adapter->db_full_task);
cancel_work_sync(&adapter->db_drop_task);
Expand All @@ -2303,6 +2305,12 @@ static void cxgb_down(struct adapter *adapter)

t4_sge_stop(adapter);
t4_free_sge_resources(adapter);

list_for_each_entry_safe(entry, tmp, &adapter->mac_hlist, list) {
list_del(&entry->list);
kfree(entry);
}

adapter->flags &= ~FULL_INIT_DONE;
}

Expand Down

0 comments on commit 2a8d84b

Please sign in to comment.