aboutsummaryrefslogtreecommitdiffstats
path: root/net
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 19:01:45 -0400
commit33b122a45a92b8029b6e416ec0bdcce09abbde22 (patch)
tree020f46cf026bd57b9800df6a24075bf516a8f24d /net
parent6bfaf37c703ac785efaefc5bfe20a279da52cac5 (diff)
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>
Diffstat (limited to 'net')
-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 f7a7f8380e38..50346a6fa17d 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)
1273 rqstp->rq_release_snd_buf = priv_release_snd_buf; 1273 rqstp->rq_release_snd_buf = priv_release_snd_buf;
1274 return 0; 1274 return 0;
1275out_free: 1275out_free:
1276 for (i--; i >= 0; i--) { 1276 rqstp->rq_enc_pages_num = i;
1277 __free_page(rqstp->rq_enc_pages[i]); 1277 priv_release_snd_buf(rqstp);
1278 }
1279out: 1278out:
1280 return -EAGAIN; 1279 return -EAGAIN;
1281} 1280}