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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/rpc/sec_gss/svc_rpcsec_gss.c
          +++ new/usr/src/uts/common/rpc/sec_gss/svc_rpcsec_gss.c
↓ open down ↓ 949 lines elided ↑ open up ↑
 950  950  
 951  951          /*
 952  952           * kgss_accept_sec_context()/gssd(1M) can be overly time
 953  953           * consuming so let's queue it and return asap.
 954  954           *
 955  955           * taskq func must free arg.
 956  956           */
 957  957          arg = kmem_alloc(sizeof (*arg), KM_SLEEP);
 958  958  
 959  959          /* taskq func must free rpc_call_arg & deserialized arguments */
 960      -        arg->rpc_call_arg = kmem_alloc(sizeof (*arg->rpc_call_arg), KM_SLEEP);
      960 +        arg->rpc_call_arg = kmem_zalloc(sizeof (*arg->rpc_call_arg), KM_SLEEP);
 961  961  
 962  962          /* deserialize arguments */
 963      -        bzero(arg->rpc_call_arg, sizeof (*arg->rpc_call_arg));
 964  963          if (!SVC_GETARGS(rqst->rq_xprt, __xdr_rpc_gss_init_arg,
 965  964              (caddr_t)arg->rpc_call_arg)) {
 966  965                  ret = RPCSEC_GSS_FAILED;
 967  966                  client_data->stale = TRUE;
 968  967                  goto error2;
 969  968          }
 970  969  
 971  970          /* get a xprt clone for taskq thread, taskq func must free it */
 972  971          arg->rq_xprt = svc_clone_init();
 973  972          svc_clone_link(rqst->rq_xprt->xp_master, arg->rq_xprt, rqst->rq_xprt);
↓ open down ↓ 951 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX