summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2018-11-30 16:11:15 -0500
committerTrond Myklebust <trond.myklebust@hammerspace.com>2018-12-02 09:43:57 -0500
commit71700bb96047f68a0aae3932466fc7c9ad5ce6c0 (patch)
tree4f47237b48cadead1e894ca6836dba19f19def1d /net/sunrpc/xprt.c
parent8dae5398ab1ac107b1517e8195ed043d5f422bd0 (diff)
downloadlinux-71700bb96047f68a0aae3932466fc7c9ad5ce6c0.tar.bz2
SUNRPC: Fix a memory leak in call_encode()
If we retransmit an RPC request, we currently end up clobbering the value of req->rq_rcv_buf.bvec that was allocated by the initial call to xprt_request_prepare(req). Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r--net/sunrpc/xprt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 86bea4520c4d..122c91c28e7c 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1623,6 +1623,8 @@ xprt_request_init(struct rpc_task *task)
req->rq_snd_buf.buflen = 0;
req->rq_rcv_buf.len = 0;
req->rq_rcv_buf.buflen = 0;
+ req->rq_snd_buf.bvec = NULL;
+ req->rq_rcv_buf.bvec = NULL;
req->rq_release_snd_buf = NULL;
xprt_reset_majortimeo(req);
dprintk("RPC: %5u reserved req %p xid %08x\n", task->tk_pid,