cxgb4: fix memory leak during module unload

Fix the memory leak in mps during module unload
path by freeing mps reference entries if the list
adpter->mps_ref is not already empty

Fixes: 28b3870578ef ("cxgb4: Re-work the logic for mps refcounting")
Signed-off-by: Raju Rangoju <rajur@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Raju Rangoju 2020-09-16 21:50:39 +05:30 committed by David S. Miller
parent 4414418595
commit f4a26a9b31

View File

@ -229,7 +229,7 @@ void cxgb4_free_mps_ref_entries(struct adapter *adap)
{
struct mps_entries_ref *mps_entry, *tmp;
if (!list_empty(&adap->mps_ref))
if (list_empty(&adap->mps_ref))
return;
spin_lock(&adap->mps_ref_lock);