mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
cxgb4vf: fix memleak in mac_hlist initialization
[ Upstream commit 24357e06ba ]
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: Arjun Vynipadath <arjun@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
@@ -718,6 +718,10 @@ 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;
|
||||
}
|
||||
|
||||
@@ -743,8 +747,6 @@ static int adapter_up(struct adapter *adapter)
|
||||
enable_rx(adapter);
|
||||
t4vf_sge_start(adapter);
|
||||
|
||||
/* Initialize hash mac addr list*/
|
||||
INIT_LIST_HEAD(&adapter->mac_hlist);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user