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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip/spd.c
          +++ new/usr/src/uts/common/inet/ip/spd.c
↓ open down ↓ 4512 lines elided ↑ open up ↑
4513 4513                  IPSID_REFRELE(ipl->ipl_local_cid);
4514 4514          if (ipl->ipl_remote_cid != NULL)
4515 4515                  IPSID_REFRELE(ipl->ipl_remote_cid);
4516 4516          mutex_destroy(&ipl->ipl_lock);
4517 4517          kmem_free(ipl, sizeof (*ipl));
4518 4518  }
4519 4519  
4520 4520  ipsec_latch_t *
4521 4521  iplatch_create()
4522 4522  {
4523      -        ipsec_latch_t *ipl = kmem_alloc(sizeof (*ipl), KM_NOSLEEP);
     4523 +        ipsec_latch_t *ipl = kmem_zalloc(sizeof (*ipl), KM_NOSLEEP);
4524 4524          if (ipl == NULL)
4525 4525                  return (ipl);
4526      -        bzero(ipl, sizeof (*ipl));
4527 4526          mutex_init(&ipl->ipl_lock, NULL, MUTEX_DEFAULT, NULL);
4528 4527          ipl->ipl_refcnt = 1;
4529 4528          return (ipl);
4530 4529  }
4531 4530  
4532 4531  /*
4533 4532   * Hash function for ID hash table.
4534 4533   */
4535 4534  static uint32_t
4536 4535  ipsid_hash(int idtype, char *idstring)
↓ open down ↓ 2375 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX