Print this page
5253 kmem_alloc/kmem_zalloc won't fail with KM_SLEEP
5254 getrbuf won't fail with KM_SLEEP

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/pciex/hotplug/pcie_hp.c
          +++ new/usr/src/uts/common/io/pciex/hotplug/pcie_hp.c
↓ open down ↓ 121 lines elided ↑ open up ↑
 122  122  pcie_copyin_nvlist(char *packed_buf, size_t packed_sz, nvlist_t **nvlp)
 123  123  {
 124  124          int             ret = DDI_SUCCESS;
 125  125          char            *packed;
 126  126          nvlist_t        *dest = NULL;
 127  127  
 128  128          if (packed_buf == NULL || packed_sz == 0)
 129  129                  return (DDI_EINVAL);
 130  130  
 131  131          /* copyin packed nvlist */
 132      -        if ((packed = kmem_alloc(packed_sz, KM_SLEEP)) == NULL)
 133      -                return (DDI_ENOMEM);
      132 +        packed = kmem_alloc(packed_sz, KM_SLEEP);
 134  133  
 135  134          if (copyin(packed_buf, packed, packed_sz) != 0) {
 136  135                  cmn_err(CE_WARN, "pcie_copyin_nvlist: copyin failed.\n");
 137  136                  ret = DDI_FAILURE;
 138  137                  goto copyin_cleanup;
 139  138          }
 140  139  
 141  140          /* unpack packed nvlist */
 142  141          if ((ret = nvlist_unpack(packed, packed_sz, &dest, KM_SLEEP)) != 0) {
 143  142                  cmn_err(CE_WARN, "pcie_copyin_nvlist: nvlist_unpack "
↓ open down ↓ 1157 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX