summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-03-19 15:36:22 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 16:01:45 -0700
commit33b122a45a92b8029b6e416ec0bdcce09abbde22 (patch)
tree020f46cf026bd57b9800df6a24075bf516a8f24d
parent6bfaf37c703ac785efaefc5bfe20a279da52cac5 (diff)
downloadkernel-crypto-33b122a45a92b8029b6e416ec0bdcce09abbde22.tar.gz
kernel-crypto-33b122a45a92b8029b6e416ec0bdcce09abbde22.tar.xz
kernel-crypto-33b122a45a92b8029b6e416ec0bdcce09abbde22.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.c5
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 f7a7f8380e3..50346a6fa17 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;
}