提交 24357e06 编写于 作者: A Arjun Vynipadath 提交者: David S. Miller

cxgb4vf: fix memleak in mac_hlist initialization

mac_hlist was initialized during adapter_up, which will be called
every time a vf device is first brought up, or every time when device
is brought up again after bringing all devices down. This means our
state of previous list is lost, causing a memleak if entries are
present in the list. To fix that, move list init to the condition
that performs initial one time adapter setup.
Signed-off-by: NArjun Vynipadath <arjun@chelsio.com>
Signed-off-by: NGanesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2a8d84bf
...@@ -722,6 +722,10 @@ static int adapter_up(struct adapter *adapter) ...@@ -722,6 +722,10 @@ static int adapter_up(struct adapter *adapter)
if (adapter->flags & USING_MSIX) if (adapter->flags & USING_MSIX)
name_msix_vecs(adapter); name_msix_vecs(adapter);
/* Initialize hash mac addr list*/
INIT_LIST_HEAD(&adapter->mac_hlist);
adapter->flags |= FULL_INIT_DONE; adapter->flags |= FULL_INIT_DONE;
} }
...@@ -747,8 +751,6 @@ static int adapter_up(struct adapter *adapter) ...@@ -747,8 +751,6 @@ static int adapter_up(struct adapter *adapter)
enable_rx(adapter); enable_rx(adapter);
t4vf_sge_start(adapter); t4vf_sge_start(adapter);
/* Initialize hash mac addr list*/
INIT_LIST_HEAD(&adapter->mac_hlist);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册