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/comstar/port/pppt/pppt.c
          +++ new/usr/src/uts/common/io/comstar/port/pppt/pppt.c
↓ open down ↓ 359 lines elided ↑ open up ↑
 360  360  
 361  361          if (iocd.pppt_version != PPPT_VERSION_1)
 362  362                  return (EINVAL);
 363  363  
 364  364          switch (cmd) {
 365  365          case PPPT_MESSAGE:
 366  366  
 367  367                  /* XXX limit buf_size ? */
 368  368                  buf_size = (size_t)iocd.pppt_buf_size;
 369  369                  buf = kmem_alloc(buf_size, KM_SLEEP);
 370      -                if (buf == NULL)
 371      -                        return (ENOMEM);
 372  370  
 373  371                  rc = ddi_copyin((void *)(unsigned long)iocd.pppt_buf,
 374  372                      buf, buf_size, flag);
 375  373                  if (rc) {
 376  374                          kmem_free(buf, buf_size);
 377  375                          return (EFAULT);
 378  376                  }
 379  377  
 380  378                  stmf_ic_rx_msg(buf, buf_size);
 381  379  
↓ open down ↓ 1071 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX