Skip to content

Commit

Permalink
sdp: debug prints in TEEC_RegisterSharedMemoryFileDescriptor
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Bech <[email protected]>
  • Loading branch information
jbech-linaro committed Oct 31, 2023
1 parent acb0885 commit a9a125d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libteec/src/tee_client_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,13 +862,17 @@ TEEC_Result TEEC_RegisterSharedMemoryFileDescriptor(TEEC_Context *ctx,
if (!ctx || !shm || fd < 0)
return TEEC_ERROR_BAD_PARAMETERS;

if (!shm->flags || (shm->flags & ~(TEEC_MEM_INPUT | TEEC_MEM_OUTPUT)))
if (!shm->flags || (shm->flags & ~(TEEC_MEM_INPUT | TEEC_MEM_OUTPUT))) {
printf("Checking parameter, found TEEC_ERROR_BAD_PARAMETERS\n");
return TEEC_ERROR_BAD_PARAMETERS;
}

data.fd = fd;
rfd = ioctl(ctx->fd, TEE_IOC_SHM_REGISTER_FD, &data);
if (rfd < 0)
if (rfd < 0) {
printf("ioctl call failed (TEE_IOC_SHM_REGISTER_FD), found TEEC_ERROR_BAD_PARAMETERS\n");
return TEEC_ERROR_BAD_PARAMETERS;
}

shm->buffer = NULL;
shm->shadow_buffer = NULL;
Expand Down

0 comments on commit a9a125d

Please sign in to comment.