diff options
Diffstat (limited to 'net/sunrpc/auth_gss/auth_gss.c')
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 519ebc17c028..4a9aa9393b97 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -225,9 +225,8 @@ gss_alloc_context(void) | |||
225 | { | 225 | { |
226 | struct gss_cl_ctx *ctx; | 226 | struct gss_cl_ctx *ctx; |
227 | 227 | ||
228 | ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); | 228 | ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); |
229 | if (ctx != NULL) { | 229 | if (ctx != NULL) { |
230 | memset(ctx, 0, sizeof(*ctx)); | ||
231 | ctx->gc_proc = RPC_GSS_PROC_DATA; | 230 | ctx->gc_proc = RPC_GSS_PROC_DATA; |
232 | ctx->gc_seq = 1; /* NetApp 6.4R1 doesn't accept seq. no. 0 */ | 231 | ctx->gc_seq = 1; /* NetApp 6.4R1 doesn't accept seq. no. 0 */ |
233 | spin_lock_init(&ctx->gc_seq_lock); | 232 | spin_lock_init(&ctx->gc_seq_lock); |
@@ -391,9 +390,8 @@ gss_alloc_msg(struct gss_auth *gss_auth, uid_t uid) | |||
391 | { | 390 | { |
392 | struct gss_upcall_msg *gss_msg; | 391 | struct gss_upcall_msg *gss_msg; |
393 | 392 | ||
394 | gss_msg = kmalloc(sizeof(*gss_msg), GFP_KERNEL); | 393 | gss_msg = kzalloc(sizeof(*gss_msg), GFP_KERNEL); |
395 | if (gss_msg != NULL) { | 394 | if (gss_msg != NULL) { |
396 | memset(gss_msg, 0, sizeof(*gss_msg)); | ||
397 | INIT_LIST_HEAD(&gss_msg->list); | 395 | INIT_LIST_HEAD(&gss_msg->list); |
398 | rpc_init_wait_queue(&gss_msg->rpc_waitqueue, "RPCSEC_GSS upcall waitq"); | 396 | rpc_init_wait_queue(&gss_msg->rpc_waitqueue, "RPCSEC_GSS upcall waitq"); |
399 | init_waitqueue_head(&gss_msg->waitqueue); | 397 | init_waitqueue_head(&gss_msg->waitqueue); |
@@ -776,10 +774,9 @@ gss_create_cred(struct rpc_auth *auth, struct auth_cred *acred, int flags) | |||
776 | dprintk("RPC: gss_create_cred for uid %d, flavor %d\n", | 774 | dprintk("RPC: gss_create_cred for uid %d, flavor %d\n", |
777 | acred->uid, auth->au_flavor); | 775 | acred->uid, auth->au_flavor); |
778 | 776 | ||
779 | if (!(cred = kmalloc(sizeof(*cred), GFP_KERNEL))) | 777 | if (!(cred = kzalloc(sizeof(*cred), GFP_KERNEL))) |
780 | goto out_err; | 778 | goto out_err; |
781 | 779 | ||
782 | memset(cred, 0, sizeof(*cred)); | ||
783 | atomic_set(&cred->gc_count, 1); | 780 | atomic_set(&cred->gc_count, 1); |
784 | cred->gc_uid = acred->uid; | 781 | cred->gc_uid = acred->uid; |
785 | /* | 782 | /* |