]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
cxgb4: fix memory leak during module unload
authorRaju Rangoju <rajur@chelsio.com>
Wed, 16 Sep 2020 16:20:39 +0000 (21:50 +0530)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 9 Nov 2020 13:47:06 +0000 (14:47 +0100)
BugLink: https://bugs.launchpad.net/bugs/1899511
[ Upstream commit f4a26a9b311d7ff9db461278faf2869d06496ef8 ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Ian May <ian.may@canonical.com>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c

index b1a073eea60b2f8fd4fd393cfb73229b40841a6f..a020e84906813f49d619ebe8ecfba335275bb374 100644 (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);