From 23a404d4f7a1e69d16752ea0dc1f33b819c33c07 Mon Sep 17 00:00:00 2001 From: Jens Wiklander Date: Tue, 28 Nov 2023 20:46:27 +0100 Subject: [PATCH] ta: storage: fix ta_storage_cmd_key_in_persistent() cleanup Fixes the error cleanup path in two places where a created test object was supposed to be removed. Fixes: 90f23353528a ("Test Persistent Object with keys") Signed-off-by: Jens Wiklander Reviewed-by: Jerome Forissier Reviewed-by: Etienne Carriere --- ta/storage/storage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ta/storage/storage.c b/ta/storage/storage.c index 37ecaa637..10ef0bd38 100644 --- a/ta/storage/storage.c +++ b/ta/storage/storage.c @@ -487,7 +487,7 @@ TEE_Result ta_storage_cmd_key_in_persistent(uint32_t param_types, result = check_obj(&keyInfo, &keyInfo2); if (result != TEE_SUCCESS) { EMSG("keyInfo and keyInfo2 are different"); - goto cleanup2; + goto cleanup3; } TEE_CloseObject(persistent_key); @@ -504,7 +504,7 @@ TEE_Result ta_storage_cmd_key_in_persistent(uint32_t param_types, result = check_obj(&keyInfo3, &keyInfo2); if (result != TEE_SUCCESS) { EMSG("keyInfo2 and keyInfo3 are different"); - goto cleanup2; + goto cleanup3; } result = TEE_AllocateOperation(&encrypt_op, alg, TEE_MODE_ENCRYPT,