SUNRPC: Fix a potential memory leak in auth_gss
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> Cc: stable@kernel.org
This commit is contained in:
@@ -1280,9 +1280,8 @@ alloc_enc_pages(struct rpc_rqst *rqstp)
|
|||||||
rqstp->rq_release_snd_buf = priv_release_snd_buf;
|
rqstp->rq_release_snd_buf = priv_release_snd_buf;
|
||||||
return 0;
|
return 0;
|
||||||
out_free:
|
out_free:
|
||||||
for (i--; i >= 0; i--) {
|
rqstp->rq_enc_pages_num = i;
|
||||||
__free_page(rqstp->rq_enc_pages[i]);
|
priv_release_snd_buf(rqstp);
|
||||||
}
|
|
||||||
out:
|
out:
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user