summaryrefslogtreecommitdiff
path: root/net/sunrpc/backchannel_rqst.c
diff options
context:
space:
mode:
authorTrond Myklebust <trondmy@gmail.com>2019-10-17 16:02:21 +0300
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2019-10-30 19:04:35 +0300
commit669996add4c92476e0f8d6b4cd2bb308d1939fd7 (patch)
tree852233b875cc79b84abc36c64ee0c7e262831d28 /net/sunrpc/backchannel_rqst.c
parent9edb455e6797bb50aa38ef71e62668966065ede8 (diff)
downloadlinux-669996add4c92476e0f8d6b4cd2bb308d1939fd7.tar.xz
SUNRPC: Destroy the back channel when we destroy the host transport
When we're destroying the host transport mechanism, we should ensure that we do not leak memory by failing to release any back channel slots that might still exist. Reported-by: Neil Brown <neilb@suse.de> Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc/backchannel_rqst.c')
-rw-r--r--net/sunrpc/backchannel_rqst.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
index 7eb251372f94..195b40c5dae4 100644
--- a/net/sunrpc/backchannel_rqst.c
+++ b/net/sunrpc/backchannel_rqst.c
@@ -220,7 +220,7 @@ void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs)
goto out;
spin_lock_bh(&xprt->bc_pa_lock);
- xprt->bc_alloc_max -= max_reqs;
+ xprt->bc_alloc_max -= min(max_reqs, xprt->bc_alloc_max);
list_for_each_entry_safe(req, tmp, &xprt->bc_pa_list, rq_bc_pa_list) {
dprintk("RPC: req=%p\n", req);
list_del(&req->rq_bc_pa_list);