Commit f4a26a9b authored by Raju Rangoju's avatar Raju Rangoju Committed by David S. Miller

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: 28b38705 ("cxgb4: Re-work the logic for mps refcounting")
Signed-off-by: default avatarRaju Rangoju <rajur@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 44144185
...@@ -229,7 +229,7 @@ void cxgb4_free_mps_ref_entries(struct adapter *adap) ...@@ -229,7 +229,7 @@ void cxgb4_free_mps_ref_entries(struct adapter *adap)
{ {
struct mps_entries_ref *mps_entry, *tmp; struct mps_entries_ref *mps_entry, *tmp;
if (!list_empty(&adap->mps_ref)) if (list_empty(&adap->mps_ref))
return; return;
spin_lock(&adap->mps_ref_lock); spin_lock(&adap->mps_ref_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment