aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r--net/sunrpc/svc.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index e9bd91265f70..e4296c8b861e 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -196,12 +196,9 @@ svc_exit_thread(struct svc_rqst *rqstp)
196 struct svc_serv *serv = rqstp->rq_server; 196 struct svc_serv *serv = rqstp->rq_server;
197 197
198 svc_release_buffer(rqstp); 198 svc_release_buffer(rqstp);
199 if (rqstp->rq_resp) 199 kfree(rqstp->rq_resp);
200 kfree(rqstp->rq_resp); 200 kfree(rqstp->rq_argp);
201 if (rqstp->rq_argp) 201 kfree(rqstp->rq_auth_data);
202 kfree(rqstp->rq_argp);
203 if (rqstp->rq_auth_data)
204 kfree(rqstp->rq_auth_data);
205 kfree(rqstp); 202 kfree(rqstp);
206 203
207 /* Release the server */ 204 /* Release the server */
@@ -313,6 +310,11 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
313 rqstp->rq_proc = proc = ntohl(svc_getu32(argv)); /* procedure number */ 310 rqstp->rq_proc = proc = ntohl(svc_getu32(argv)); /* procedure number */
314 311
315 progp = serv->sv_program; 312 progp = serv->sv_program;
313
314 for (progp = serv->sv_program; progp; progp = progp->pg_next)
315 if (prog == progp->pg_prog)
316 break;
317
316 /* 318 /*
317 * Decode auth data, and add verifier to reply buffer. 319 * Decode auth data, and add verifier to reply buffer.
318 * We do this before anything else in order to get a decent 320 * We do this before anything else in order to get a decent
@@ -320,7 +322,7 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
320 */ 322 */
321 auth_res = svc_authenticate(rqstp, &auth_stat); 323 auth_res = svc_authenticate(rqstp, &auth_stat);
322 /* Also give the program a chance to reject this call: */ 324 /* Also give the program a chance to reject this call: */
323 if (auth_res == SVC_OK) { 325 if (auth_res == SVC_OK && progp) {
324 auth_stat = rpc_autherr_badcred; 326 auth_stat = rpc_autherr_badcred;
325 auth_res = progp->pg_authenticate(rqstp); 327 auth_res = progp->pg_authenticate(rqstp);
326 } 328 }
@@ -340,10 +342,7 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp)
340 case SVC_COMPLETE: 342 case SVC_COMPLETE:
341 goto sendit; 343 goto sendit;
342 } 344 }
343 345
344 for (progp = serv->sv_program; progp; progp = progp->pg_next)
345 if (prog == progp->pg_prog)
346 break;
347 if (progp == NULL) 346 if (progp == NULL)
348 goto err_bad_prog; 347 goto err_bad_prog;
349 348