cxgb4: fix memory leak during module unload
authorRaju Rangoju <rajur@chelsio.com>
Wed, 16 Sep 2020 16:20:39 +0000 (21:50 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Sep 2020 16:05:21 +0000 (18:05 +0200)
commita01b4105d2f00aaeb0425d420d0794cde7c80c4c
tree8194e0bb1aa0530ecc0f870302c6aed0ea1d1bf5
parent0d7002517f9bb2de70ab42787413bd2767862692
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