aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/tee/tee_svc_storage.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/tee/tee_svc_storage.c b/core/tee/tee_svc_storage.c
index 2f8a53a4..a412f15d 100644
--- a/core/tee/tee_svc_storage.c
+++ b/core/tee/tee_svc_storage.c
@@ -240,10 +240,12 @@ static TEE_Result tee_svc_storage_read_head(struct tee_obj *o)
bytes = head.attr_size;
res = fops->read(o->fh, sizeof(struct tee_svc_storage_head),
attr, &bytes);
- if (res != TEE_SUCCESS || bytes != head.attr_size) {
+ if (res == TEE_ERROR_OUT_OF_MEMORY)
+ goto exit;
+ if (res != TEE_SUCCESS || bytes != head.attr_size)
res = TEE_ERROR_CORRUPT_OBJECT;
+ if (res)
goto exit;
- }
}
res = tee_obj_attr_from_binary(o, attr, head.attr_size);