diff options
-rw-r--r-- | include/linux/sunrpc/svcauth.h | 7 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index ff374ab30839..95c956613a9c 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
@@ -25,6 +25,13 @@ struct svc_cred { | |||
25 | char *cr_principal; /* for gss */ | 25 | char *cr_principal; /* for gss */ |
26 | }; | 26 | }; |
27 | 27 | ||
28 | static inline void init_svc_cred(struct svc_cred *cred) | ||
29 | { | ||
30 | cred->cr_group_info = NULL; | ||
31 | cred->cr_principal = NULL; | ||
32 | cred->cr_gss_mech = NULL; | ||
33 | } | ||
34 | |||
28 | static inline void free_svc_cred(struct svc_cred *cred) | 35 | static inline void free_svc_cred(struct svc_cred *cred) |
29 | { | 36 | { |
30 | if (cred->cr_group_info) | 37 | if (cred->cr_group_info) |
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 29b4ba93ab3c..8d7860ee2398 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -377,8 +377,7 @@ rsc_init(struct cache_head *cnew, struct cache_head *ctmp) | |||
377 | new->handle.data = tmp->handle.data; | 377 | new->handle.data = tmp->handle.data; |
378 | tmp->handle.data = NULL; | 378 | tmp->handle.data = NULL; |
379 | new->mechctx = NULL; | 379 | new->mechctx = NULL; |
380 | new->cred.cr_group_info = NULL; | 380 | init_svc_cred(&new->cred); |
381 | new->cred.cr_principal = NULL; | ||
382 | } | 381 | } |
383 | 382 | ||
384 | static void | 383 | static void |
@@ -392,9 +391,8 @@ update_rsc(struct cache_head *cnew, struct cache_head *ctmp) | |||
392 | memset(&new->seqdata, 0, sizeof(new->seqdata)); | 391 | memset(&new->seqdata, 0, sizeof(new->seqdata)); |
393 | spin_lock_init(&new->seqdata.sd_lock); | 392 | spin_lock_init(&new->seqdata.sd_lock); |
394 | new->cred = tmp->cred; | 393 | new->cred = tmp->cred; |
395 | tmp->cred.cr_group_info = NULL; | ||
396 | new->cred.cr_principal = tmp->cred.cr_principal; | 394 | new->cred.cr_principal = tmp->cred.cr_principal; |
397 | tmp->cred.cr_principal = NULL; | 395 | init_svc_cred(&tmp->cred); |
398 | } | 396 | } |
399 | 397 | ||
400 | static struct cache_head * | 398 | static struct cache_head * |