diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2007-12-12 18:21:17 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-02-01 16:42:07 -0500 |
commit | 980e5a40a44400edc3f75b7931b8e75fcc3c21a3 (patch) | |
tree | 6edcef9f67ba32d817da97f500a2374e19734bd6 /net/sunrpc/auth_gss | |
parent | 5c002b3bb294a637312cab7ad92a0deafa05a758 (diff) |
nfsd: fix rsi_cache reference count leak
For some reason we haven't been put()'ing the reference count here.
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index aa790bb4f7a1..688cc31040f3 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -975,6 +975,7 @@ static int svcauth_gss_handle_init(struct svc_rqst *rqstp, | |||
975 | struct kvec *resv = &rqstp->rq_res.head[0]; | 975 | struct kvec *resv = &rqstp->rq_res.head[0]; |
976 | struct xdr_netobj tmpobj; | 976 | struct xdr_netobj tmpobj; |
977 | struct rsi *rsip, rsikey; | 977 | struct rsi *rsip, rsikey; |
978 | int ret; | ||
978 | 979 | ||
979 | /* Read the verifier; should be NULL: */ | 980 | /* Read the verifier; should be NULL: */ |
980 | *authp = rpc_autherr_badverf; | 981 | *authp = rpc_autherr_badverf; |
@@ -1014,23 +1015,27 @@ static int svcauth_gss_handle_init(struct svc_rqst *rqstp, | |||
1014 | /* No upcall result: */ | 1015 | /* No upcall result: */ |
1015 | return SVC_DROP; | 1016 | return SVC_DROP; |
1016 | case 0: | 1017 | case 0: |
1018 | ret = SVC_DROP; | ||
1017 | /* Got an answer to the upcall; use it: */ | 1019 | /* Got an answer to the upcall; use it: */ |
1018 | if (gss_write_init_verf(rqstp, rsip)) | 1020 | if (gss_write_init_verf(rqstp, rsip)) |
1019 | return SVC_DROP; | 1021 | goto out; |
1020 | if (resv->iov_len + 4 > PAGE_SIZE) | 1022 | if (resv->iov_len + 4 > PAGE_SIZE) |
1021 | return SVC_DROP; | 1023 | goto out; |
1022 | svc_putnl(resv, RPC_SUCCESS); | 1024 | svc_putnl(resv, RPC_SUCCESS); |
1023 | if (svc_safe_putnetobj(resv, &rsip->out_handle)) | 1025 | if (svc_safe_putnetobj(resv, &rsip->out_handle)) |
1024 | return SVC_DROP; | 1026 | goto out; |
1025 | if (resv->iov_len + 3 * 4 > PAGE_SIZE) | 1027 | if (resv->iov_len + 3 * 4 > PAGE_SIZE) |
1026 | return SVC_DROP; | 1028 | goto out; |
1027 | svc_putnl(resv, rsip->major_status); | 1029 | svc_putnl(resv, rsip->major_status); |
1028 | svc_putnl(resv, rsip->minor_status); | 1030 | svc_putnl(resv, rsip->minor_status); |
1029 | svc_putnl(resv, GSS_SEQ_WIN); | 1031 | svc_putnl(resv, GSS_SEQ_WIN); |
1030 | if (svc_safe_putnetobj(resv, &rsip->out_token)) | 1032 | if (svc_safe_putnetobj(resv, &rsip->out_token)) |
1031 | return SVC_DROP; | 1033 | goto out; |
1032 | } | 1034 | } |
1033 | return SVC_COMPLETE; | 1035 | ret = SVC_COMPLETE; |
1036 | out: | ||
1037 | cache_put(&rsip->h, &rsi_cache); | ||
1038 | return ret; | ||
1034 | } | 1039 | } |
1035 | 1040 | ||
1036 | /* | 1041 | /* |