Print this page
6141 use kmem_zalloc instead of kmem_alloc + bzero/memset


 940                 ret = AUTH_FAILED;
 941                 return (ret);
 942         }
 943 
 944         mutex_enter(&client_data->clm);
 945         if (client_data->stale) {
 946                 ret = RPCSEC_GSS_NOCRED;
 947                 RPCGSS_LOG0(1, "_svcrpcsec_gss: client data stale\n");
 948                 goto error2;
 949         }
 950 
 951         /*
 952          * kgss_accept_sec_context()/gssd(1M) can be overly time
 953          * consuming so let's queue it and return asap.
 954          *
 955          * taskq func must free arg.
 956          */
 957         arg = kmem_alloc(sizeof (*arg), KM_SLEEP);
 958 
 959         /* taskq func must free rpc_call_arg & deserialized arguments */
 960         arg->rpc_call_arg = kmem_alloc(sizeof (*arg->rpc_call_arg), KM_SLEEP);
 961 
 962         /* deserialize arguments */
 963         bzero(arg->rpc_call_arg, sizeof (*arg->rpc_call_arg));
 964         if (!SVC_GETARGS(rqst->rq_xprt, __xdr_rpc_gss_init_arg,
 965             (caddr_t)arg->rpc_call_arg)) {
 966                 ret = RPCSEC_GSS_FAILED;
 967                 client_data->stale = TRUE;
 968                 goto error2;
 969         }
 970 
 971         /* get a xprt clone for taskq thread, taskq func must free it */
 972         arg->rq_xprt = svc_clone_init();
 973         svc_clone_link(rqst->rq_xprt->xp_master, arg->rq_xprt, rqst->rq_xprt);
 974         arg->rq_xprt->xp_xid = rqst->rq_xprt->xp_xid;
 975 
 976 
 977         /* set the appropriate wrap/unwrap routine for RPCSEC_GSS */
 978         arg->rq_xprt->xp_auth.svc_ah_ops = svc_rpc_gss_ops;
 979         arg->rq_xprt->xp_auth.svc_ah_private = (caddr_t)client_data;
 980 
 981         /* get a dup of rpc msg for taskq thread */
 982         arg->msg = rpc_msg_dup(msg);  /* taskq func must free msg dup */
 983 




 940                 ret = AUTH_FAILED;
 941                 return (ret);
 942         }
 943 
 944         mutex_enter(&client_data->clm);
 945         if (client_data->stale) {
 946                 ret = RPCSEC_GSS_NOCRED;
 947                 RPCGSS_LOG0(1, "_svcrpcsec_gss: client data stale\n");
 948                 goto error2;
 949         }
 950 
 951         /*
 952          * kgss_accept_sec_context()/gssd(1M) can be overly time
 953          * consuming so let's queue it and return asap.
 954          *
 955          * taskq func must free arg.
 956          */
 957         arg = kmem_alloc(sizeof (*arg), KM_SLEEP);
 958 
 959         /* taskq func must free rpc_call_arg & deserialized arguments */
 960         arg->rpc_call_arg = kmem_zalloc(sizeof (*arg->rpc_call_arg), KM_SLEEP);
 961 
 962         /* deserialize arguments */

 963         if (!SVC_GETARGS(rqst->rq_xprt, __xdr_rpc_gss_init_arg,
 964             (caddr_t)arg->rpc_call_arg)) {
 965                 ret = RPCSEC_GSS_FAILED;
 966                 client_data->stale = TRUE;
 967                 goto error2;
 968         }
 969 
 970         /* get a xprt clone for taskq thread, taskq func must free it */
 971         arg->rq_xprt = svc_clone_init();
 972         svc_clone_link(rqst->rq_xprt->xp_master, arg->rq_xprt, rqst->rq_xprt);
 973         arg->rq_xprt->xp_xid = rqst->rq_xprt->xp_xid;
 974 
 975 
 976         /* set the appropriate wrap/unwrap routine for RPCSEC_GSS */
 977         arg->rq_xprt->xp_auth.svc_ah_ops = svc_rpc_gss_ops;
 978         arg->rq_xprt->xp_auth.svc_ah_private = (caddr_t)client_data;
 979 
 980         /* get a dup of rpc msg for taskq thread */
 981         arg->msg = rpc_msg_dup(msg);  /* taskq func must free msg dup */
 982