cxgb4: fix memory leak during module unload
commit2583159735e4e4e6de7950fcd3f475b27bada2c1
authorRaju Rangoju <rajur@chelsio.com>
Wed, 16 Sep 2020 16:20:39 +0000 (16 21:50 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Sep 2020 16:03:11 +0000 (26 18:03 +0200)
treeee5e7908c57605a0cbfec11e227d1be5ea6acc80
parent6743a9b020fd741061fa3ef200f4c938754220ca
cxgb4: fix memory leak during module unload

[ 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>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c