diff mbox series

[net] cxgb4: fix memory leak during module unload

Message ID 20200916162039.26369-1-rajur@chelsio.com
State Accepted
Delegated to: David Miller
Headers show
Series [net] cxgb4: fix memory leak during module unload | expand

Commit Message

Raju Rangoju Sept. 16, 2020, 4:20 p.m. UTC
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>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Sept. 17, 2020, 11:34 p.m. UTC | #1
From: Raju Rangoju <rajur@chelsio.com>
Date: Wed, 16 Sep 2020 21:50:39 +0530

> 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>

Applied and queued up for -stable, thank you.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c
index b1a073eea60b..a020e8490681 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c
@@ -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);