1 From cdead7cf12896c0e50a8be2e52de52c364603095 Mon Sep 17 00:00:00 2001
2 From: Trond Myklebust <Trond.Myklebust@netapp.com>
3 Date: Fri, 19 Mar 2010 15:36:22 -0400
4 Subject: SUNRPC: Fix a potential memory leak in auth_gss
6 From: Trond Myklebust <Trond.Myklebust@netapp.com>
8 commit cdead7cf12896c0e50a8be2e52de52c364603095 upstream.
10 The function alloc_enc_pages() currently fails to release the pointer
11 rqstp->rq_enc_pages in the error path.
13 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
14 Acked-by: J. Bruce Fields <bfields@citi.umich.edu>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
18 net/sunrpc/auth_gss/auth_gss.c | 5 ++---
19 1 file changed, 2 insertions(+), 3 deletions(-)
21 --- a/net/sunrpc/auth_gss/auth_gss.c
22 +++ b/net/sunrpc/auth_gss/auth_gss.c
23 @@ -1273,9 +1273,8 @@ alloc_enc_pages(struct rpc_rqst *rqstp)
24 rqstp->rq_release_snd_buf = priv_release_snd_buf;
27 - for (i--; i >= 0; i--) {
28 - __free_page(rqstp->rq_enc_pages[i]);
30 + rqstp->rq_enc_pages_num = i;
31 + priv_release_snd_buf(rqstp);