Skip to content

Commit

Permalink
cxgb4: fix memory leak during module unload
Browse files Browse the repository at this point in the history
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: 28b3870 ("cxgb4: Re-work the logic for mps refcounting")
Signed-off-by: Raju Rangoju <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
RajuRangoju authored and davem330 committed Sep 17, 2020
1 parent 4414418 commit f4a26a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f4a26a9

Please sign in to comment.