Skip to content

Commit

Permalink
core: fix calls to tee_pobj_get() for object opening
Browse files Browse the repository at this point in the history
Fixes calls to tee_pobj_get() that use boolean false are argument
where a enum tee_pobj_usage argument is expected.

Function tee_pobj_get() used to take a boolean @temporary argument
between old 2.4.0 and 3.11.0 release tags. Since commit [1] merged in
release tag 3.11.0, function prototype changed but the commit missed
few calls that since still use value false (0), treated as enumerated
value TEE_POBJ_USAGE_OPEN. This change replaces these occurrences with
use of TEE_POBJ_USAGE_OPEN argument.

Link: 6885abf ("core: tee_pobj_get() takes an enum tee_pobj_usage") [1]
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
  • Loading branch information
etienne-lms committed Nov 8, 2023
1 parent 91d8d7b commit 59dcd81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions core/arch/arm/kernel/stmm_sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ static TEE_Result sec_storage_obj_read(unsigned long storage_id, char *obj_id,
sess = ts_get_current_session();

res = tee_pobj_get(&sess->ctx->uuid, obj_id, obj_id_len, flags,
false, fops, &po);
TEE_POBJ_USAGE_OPEN, fops, &po);
if (res != TEE_SUCCESS)
return res;

Expand Down Expand Up @@ -714,7 +714,7 @@ static TEE_Result sec_storage_obj_write(unsigned long storage_id, char *obj_id,
sess = ts_get_current_session();

res = tee_pobj_get(&sess->ctx->uuid, obj_id, obj_id_len, flags,
false, fops, &po);
TEE_POBJ_USAGE_OPEN, fops, &po);
if (res != TEE_SUCCESS)
return res;

Expand Down
8 changes: 4 additions & 4 deletions core/pta/attestation.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ static TEE_Result sec_storage_obj_read(TEE_UUID *uuid, uint32_t storage_id,
if (obj_id_len > TEE_OBJECT_ID_MAX_LEN)
return TEE_ERROR_BAD_PARAMETERS;

res = tee_pobj_get(uuid, (void *)obj_id, obj_id_len, flags, false, fops,
&po);
res = tee_pobj_get(uuid, (void *)obj_id, obj_id_len, flags,
TEE_POBJ_USAGE_OPEN, fops, &po);
if (res)
return res;

Expand Down Expand Up @@ -272,8 +272,8 @@ static TEE_Result sec_storage_obj_write(TEE_UUID *uuid, uint32_t storage_id,
if (obj_id_len > TEE_OBJECT_ID_MAX_LEN)
return TEE_ERROR_BAD_PARAMETERS;

res = tee_pobj_get(uuid, (void *)obj_id, obj_id_len, flags, false,
fops, &po);
res = tee_pobj_get(uuid, (void *)obj_id, obj_id_len, flags,
TEE_POBJ_USAGE_OPEN, fops, &po);
if (res)
return res;

Expand Down

0 comments on commit 59dcd81

Please sign in to comment.