 diff -Nur psw/urts/linux/enclave_creator_hw.cpp psw/urts/linux/enclave_creator_hw.cpp
 --- psw/urts/linux/enclave_creator_hw.cpp
 +++ psw/urts/linux/enclave_creator_hw.cpp
-@@ -174,7 +174,7 @@
-         return SGX_ERROR_UNEXPECTED;
+@@ -171,10 +171,10 @@
+ 
+     enclave_create_sgx_t enclave_create_sgx = {0};
+     if (0 != memcpy_s(enclave_create_sgx.secs, SECS_SIZE, secs, SECS_SIZE))
+-        return SGX_ERROR_UNEXPECTED;
++        return SGX_ERROR_OUT_OF_MEMORY;
  
      uint32_t enclave_error = ENCLAVE_ERROR_SUCCESS;
 -    void* enclave_base = enclave_create(NULL, (size_t)secs->size, 0, ENCLAVE_TYPE_SGX2, &enclave_create_sgx, sizeof(enclave_create_sgx_t), &enclave_error);

 {
     uint64_t page_frame = rva >> SE_PAGE_SHIFT;
     //NOTE:
@@ -181,7 +183,7 @@
     return SGX_SUCCESS;
 }

 
     if (enclave_error)
         return error_api2urts(enclave_error);
@@ -208,7 +208,7 @@
 
     enclave_init_sgx_t enclave_init_sgx = {0};
     if (0 != memcpy_s(enclave_init_sgx.sigstruct, SIGSTRUCT_SIZE, enclave_css, SIGSTRUCT_SIZE))
-        return SGX_ERROR_UNEXPECTED;
+        return SGX_ERROR_OUT_OF_MEMORY;
 
     uint32_t enclave_error = ENCLAVE_ERROR_SUCCESS;
     enclave_initialize((void*)enclave_id, &enclave_init_sgx, sizeof(enclave_init_sgx), &enclave_error);
diff -Nur psw/urts/linux/misc.cpp psw/urts/linux/misc.cpp
--- psw/urts/linux/misc.cpp
+++ psw/urts/linux/misc.cpp
