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

@@ -22,12 +22,10 @@
 /*
  * 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>

@@ -214,22 +212,13 @@
 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);
-        }
+        dca->dca_buf1 = kmem_alloc(RANDOM_BUFFER_SIZE, KM_SLEEP);
 
-        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);
-        }
+        dca->dca_buf2 = kmem_alloc(RANDOM_BUFFER_SIZE, KM_SLEEP);
 
         return (CRYPTO_SUCCESS);
 }
 
 void