diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-19 15:36:22 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-01 15:58:41 -0700 |
commit | ea374cba047ddb056ca4b4f8813282ad7642201e (patch) | |
tree | eda9ec56c42447a6fde36441085b3225a7af4da0 | |
parent | 632682a2eccc96b1b5238e274dde6b18a5b670f1 (diff) | |
download | lwn-ea374cba047ddb056ca4b4f8813282ad7642201e.tar.gz lwn-ea374cba047ddb056ca4b4f8813282ad7642201e.zip |
SUNRPC: Fix a potential memory leak in auth_gss
commit cdead7cf12896c0e50a8be2e52de52c364603095 upstream.
The function alloc_enc_pages() currently fails to release the pointer
rqstp->rq_enc_pages in the error path.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 9c5a19d9dbce..2370ab49dd4b 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c @@ -1273,9 +1273,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; } |