diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2006-06-30 04:56:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-30 14:25:40 -0400 |
commit | 1df0cada03644e37ae6fefd7c0267d9a531991e2 (patch) | |
tree | 5b57b7749bba84ff31e4966e18d237e1dc77c2f2 /net/sunrpc/auth_gss/svcauth_gss.c | |
parent | 270d56e536dcd37cc819a6adb51d918185411048 (diff) |
[PATCH] knfsd: svcrpc: gss: simplify rsc_parse()
Adopt a simpler convention for gss_mech_put(), to simplify rsc_parse().
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/sunrpc/auth_gss/svcauth_gss.c')
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 12 |
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; |
505 | out: | 500 | out: |
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); |