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

*** 22,33 **** /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - #pragma ident "%Z%%M% %I% %E% SMI" - /* * Deimos - cryptographic acceleration based upon Broadcom 582x. */ #include <sys/types.h> --- 22,31 ----
*** 214,235 **** dca_random_init(dca_t *dca) { /* Mutex for the local random number pool */ mutex_init(&dca->dca_random_lock, NULL, MUTEX_DRIVER, NULL); ! if ((dca->dca_buf1 = kmem_alloc(RANDOM_BUFFER_SIZE, KM_SLEEP)) == ! NULL) { ! mutex_destroy(&dca->dca_random_lock); ! return (CRYPTO_FAILED); ! } ! if ((dca->dca_buf2 = kmem_alloc(RANDOM_BUFFER_SIZE, KM_SLEEP)) == ! NULL) { ! mutex_destroy(&dca->dca_random_lock); ! kmem_free(dca->dca_buf1, RANDOM_BUFFER_SIZE); ! return (CRYPTO_FAILED); ! } return (CRYPTO_SUCCESS); } void --- 212,224 ---- dca_random_init(dca_t *dca) { /* Mutex for the local random number pool */ mutex_init(&dca->dca_random_lock, NULL, MUTEX_DRIVER, NULL); ! dca->dca_buf1 = kmem_alloc(RANDOM_BUFFER_SIZE, KM_SLEEP); ! dca->dca_buf2 = kmem_alloc(RANDOM_BUFFER_SIZE, KM_SLEEP); return (CRYPTO_SUCCESS); } void