SUNRPC: Fix a potential memory leak in auth_gss
Subsystems (3)
PATCH 1/1 SUNRPC: Fix a potential memory leak in auth_gss
From: Trond Myklebust <[email protected]>
The function alloc_enc_pages() currently fails to release the pointer rqstp->rq_enc_pages in the error path.
Signed-off-by Trond Myklebust <[email protected]>
---
net/sunrpc/auth_gss/auth_gss.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
net/sunrpc/auth_gss/auth_gss.c +2 -3
@@ -1280,9 +1280,8 @@ alloc_enc_pages(struct rpc_rqst *rqstp) rqstp->rq_release_snd_buf = priv_release_snd_buf;return 0 ; out_free: -for (i--; i >=0 ; i--) { -__free_page (rqstp->rq_enc_pages[i]); - } + rqstp->rq_enc_pages_num = i; +priv_release_snd_buf (rqstp); out:return -EAGAIN ; }
A message that is not in the archive (sent off-list or not yet received): 1269026879.10771.2.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]
Dr. J. Bruce Fields
Acked-by J. Bruce FieldsQuoted 4 lines · Trond Myklebust
From: Trond Myklebust <[email protected]>
The function
alloc_enc_pages()currently fails to release the pointerrqstp->rq_enc_pagesin the error path.
Thanks, and it's simpler, too. For what it's worth:
Acked-by J. Bruce Fields <[email protected]>
--b.
Quoted 25 lines
Signed-off-by Trond Myklebust <[email protected]>---
net/sunrpc/auth_gss/auth_gss.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)net/sunrpc/auth_gss/auth_gss.c +2
-3@@ -1280,9 +1280,8 @@ alloc_enc_pages(struct rpc_rqst *rqstp) rqstp->rq_release_snd_buf = priv_release_snd_buf;return 0 ; out_free: -for (i--; i >=0 ; i--) { -__free_page (rqstp->rq_enc_pages[i]); - } + rqstp->rq_enc_pages_num = i; +priv_release_snd_buf (rqstp); out:return -EAGAIN ; }