Do not translate both OUT_OF_MEMORY and STORAGE_NO_SPACE to -ENOSPC; we have -ENOMEM which is more fitting for the former. OTOH, a new addition to op-tee returns TEE_ERROR_SHORT_BUFFER in case the provided buffer is too small to hold the result, so also use -ENOSPC for that.
Similarly, -ENOENT is a better match for ITEM_NOT_FOUND than "some IO went wrong". None of the callers currently care about the actual error code, so this makes no functional change, but we will add special handling of the -ENOSPC in a later patch. Signed-off-by: Rasmus Villemoes <[email protected]> --- cmd/optee_rpmb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/optee_rpmb.c b/cmd/optee_rpmb.c index b155278ee2a..9a3274c4332 100644 --- a/cmd/optee_rpmb.c +++ b/cmd/optee_rpmb.c @@ -52,10 +52,12 @@ static int invoke_func(u32 func, ulong num_param, struct tee_param *param) case TEE_SUCCESS: return 0; case TEE_ERROR_OUT_OF_MEMORY: + return -ENOMEM; case TEE_ERROR_STORAGE_NO_SPACE: + case TEE_ERROR_SHORT_BUFFER: return -ENOSPC; case TEE_ERROR_ITEM_NOT_FOUND: - return -EIO; + return -ENOENT; case TEE_ERROR_TARGET_DEAD: /* * The TA has paniced, close the session to reload the TA -- 2.55.0
