Skip to content

Commit

Permalink
xtest: regression: check and report fs_unlink() return value
Browse files Browse the repository at this point in the history
Let ta_storage_cmd_unlink() propagate the return value from
TEE_CloseAndDeletePersistentObject1() instead of returning
TEE_SUCCESS.

Check and report the return value from fs_unlink() in
check_storage_available().

Signed-off-by: pengyinjie <[email protected]>
Reviewed-by: Jens Wiklander <[email protected]>
  • Loading branch information
XMPengYinjie authored and jforissier committed Jun 7, 2024
1 parent a19c6d9 commit 091619c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion host/xtest/regression_6000.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,9 @@ static TEEC_Result check_storage_available(uint32_t id, bool *avail)
switch (res) {
case TEEC_SUCCESS:
*avail = true;
fs_unlink(&sess, obj);
res = fs_unlink(&sess, obj);
if (res != TEEC_SUCCESS)
Do_ADBG_Log("fs_unlink() failed");
break;
case TEE_ERROR_ITEM_NOT_FOUND:
case TEE_ERROR_STORAGE_NOT_AVAILABLE:
Expand Down
4 changes: 1 addition & 3 deletions ta/storage/storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,7 @@ TEE_Result ta_storage_cmd_unlink(uint32_t param_types, TEE_Param params[4])
(TEE_PARAM_TYPE_VALUE_INPUT, TEE_PARAM_TYPE_NONE,
TEE_PARAM_TYPE_NONE, TEE_PARAM_TYPE_NONE));

TEE_CloseAndDeletePersistentObject1(o);

return TEE_SUCCESS;
return TEE_CloseAndDeletePersistentObject1(o);
}

TEE_Result ta_storage_cmd_rename(uint32_t command, uint32_t param_types,
Expand Down

0 comments on commit 091619c

Please sign in to comment.