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/fibre-channel/fca/qlge/qlge_flash.c
          +++ new/usr/src/uts/common/io/fibre-channel/fca/qlge/qlge_flash.c
↓ open down ↓ 233 lines elided ↑ open up ↑
 234  234          if (faddr > qlge->fdesc.flash_size) {
 235  235                  cmn_err(CE_WARN, "%s(%d): invalid flash write address %x",
 236  236                      __func__, qlge->instance, faddr);
 237  237                  return (DDI_FAILURE);
 238  238          }
 239  239          /* Get semaphore to access Flash Address and Flash Data Registers */
 240  240          if (ql_sem_spinlock(qlge, QL_FLASH_SEM_MASK) != DDI_SUCCESS) {
 241  241                  return (DDI_FAILURE);
 242  242          }
 243  243          temp = kmem_zalloc(sector_size, KM_SLEEP);
 244      -        if (temp == NULL) {
 245      -                cmn_err(CE_WARN, "%s(%d): Unable to allocate buffer",
 246      -                    __func__, qlge->instance);
 247      -                ql_sem_unlock(qlge, QL_FLASH_SEM_MASK);
 248      -                return (DDI_FAILURE);
 249      -        }
 250  244  
 251  245          (void) ql_unprotect_flash(qlge);
 252  246  
 253  247          get_sector_number(qlge, faddr, &start_block);
 254  248          get_sector_number(qlge, faddr + len - 1, &end_block);
 255  249  
 256  250          QL_PRINT(DBG_FLASH, ("%s(%d) start_block %x, end_block %x\n",
 257  251              __func__, qlge->instance, start_block, end_block));
 258  252  
 259  253          for (num = start_block; num <= end_block; num++) {
↓ open down ↓ 1152 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX