summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--8efb1e1c-37e5-4326-a5d68c33726c7d57.ta5569
-rw-r--r--aml_keymaster_device.cpp4
2 files changed, 2758 insertions, 2815 deletions
diff --git a/aml_keymaster_device.cpp b/aml_keymaster_device.cpp
index df8b9b9..9a19a8c 100644
--- a/aml_keymaster_device.cpp
+++ b/aml_keymaster_device.cpp
@@ -122,6 +122,7 @@ AmlKeymasterDevice::AmlKeymasterDevice(const hw_module_t* module) {
error_ = translate_error(rc);
if (rc != TEEC_SUCCESS) {
ALOGE("failed to connect to keymaster (0x%x)", rc);
+ error_ = KM_ERROR_SECURE_HW_COMMUNICATION_FAILED;
return;
}
@@ -144,7 +145,8 @@ AmlKeymasterDevice::AmlKeymasterDevice(const hw_module_t* module) {
}
AmlKeymasterDevice::~AmlKeymasterDevice() {
- aml_keymaster_disconnect(&KM_context, &KM_session);
+ if (KM_session.ctx != NULL)
+ aml_keymaster_disconnect(&KM_context, &KM_session);
}
namespace {