aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss/svcauth_gss.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/auth_gss/svcauth_gss.c')
-rw-r--r--net/sunrpc/auth_gss/svcauth_gss.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index d51e316c5821..71f57a5d800d 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -425,6 +425,7 @@ static int rsc_parse(struct cache_detail *cd,
425 struct rsc rsci, *rscp = NULL; 425 struct rsc rsci, *rscp = NULL;
426 time_t expiry; 426 time_t expiry;
427 int status = -EINVAL; 427 int status = -EINVAL;
428 struct gss_api_mech *gm = NULL;
428 429
429 memset(&rsci, 0, sizeof(rsci)); 430 memset(&rsci, 0, sizeof(rsci));
430 /* context handle */ 431 /* context handle */
@@ -453,7 +454,6 @@ static int rsc_parse(struct cache_detail *cd,
453 set_bit(CACHE_NEGATIVE, &rsci.h.flags); 454 set_bit(CACHE_NEGATIVE, &rsci.h.flags);
454 else { 455 else {
455 int N, i; 456 int N, i;
456 struct gss_api_mech *gm;
457 457
458 /* gid */ 458 /* gid */
459 if (get_int(&mesg, &rsci.cred.cr_gid)) 459 if (get_int(&mesg, &rsci.cred.cr_gid))
@@ -488,21 +488,17 @@ static int rsc_parse(struct cache_detail *cd,
488 status = -EINVAL; 488 status = -EINVAL;
489 /* mech-specific data: */ 489 /* mech-specific data: */
490 len = qword_get(&mesg, buf, mlen); 490 len = qword_get(&mesg, buf, mlen);
491 if (len < 0) { 491 if (len < 0)
492 gss_mech_put(gm);
493 goto out; 492 goto out;
494 }
495 status = gss_import_sec_context(buf, len, gm, &rsci.mechctx); 493 status = gss_import_sec_context(buf, len, gm, &rsci.mechctx);
496 if (status) { 494 if (status)
497 gss_mech_put(gm);
498 goto out; 495 goto out;
499 }
500 gss_mech_put(gm);
501 } 496 }
502 rsci.h.expiry_time = expiry; 497 rsci.h.expiry_time = expiry;
503 rscp = rsc_update(&rsci, rscp); 498 rscp = rsc_update(&rsci, rscp);
504 status = 0; 499 status = 0;
505out: 500out:
501 gss_mech_put(gm);
506 rsc_free(&rsci); 502 rsc_free(&rsci);
507 if (rscp) 503 if (rscp)
508 cache_put(&rscp->h, &rsc_cache); 504 cache_put(&rscp->h, &rsc_cache);