aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
diff options
context:
space:
mode:
authorArjun Vynipadath <arjun@chelsio.com>2018-11-20 12:11:39 +0530
committerDavid S. Miller <davem@davemloft.net>2018-11-20 10:29:36 -0800
commitb539ea60f5043b9acd7562f04fa2117f18776cbb (patch)
tree2026ef28250849c40339e2dc647c6adbfdc39491 /drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
parenttcp: drop dst in tcp_add_backlog() (diff)
downloadlinux-dev-b539ea60f5043b9acd7562f04fa2117f18776cbb.tar.xz
linux-dev-b539ea60f5043b9acd7562f04fa2117f18776cbb.zip
cxgb4/cxgb4vf: Fix mac_hlist initialization and free
Null pointer dereference seen when cxgb4vf driver is unloaded without bringing up any interfaces, moving mac_hlist initialization to driver probe and free the mac_hlist in remove to fix the issue. Fixes: 24357e06ba51 ("cxgb4vf: fix memleak in mac_hlist initialization") Signed-off-by: Arjun Vynipadath <arjun@chelsio.com> Signed-off-by: Casey Leedom <leedom@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 8ec503c88c06..8a2ad6b387ea 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -723,9 +723,6 @@ static int adapter_up(struct adapter *adapter)
if (adapter->flags & USING_MSIX)
name_msix_vecs(adapter);
- /* Initialize hash mac addr list*/
- INIT_LIST_HEAD(&adapter->mac_hlist);
-
adapter->flags |= FULL_INIT_DONE;
}
@@ -3038,6 +3035,9 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,
if (err)
goto err_unmap_bar;
+ /* Initialize hash mac addr list */
+ INIT_LIST_HEAD(&adapter->mac_hlist);
+
/*
* Allocate our "adapter ports" and stitch everything together.
*/