Skip to content

Commit 401cf81

Browse files
Summer-ARMDavid Hu
authored and
David Hu
committed
SPM: Correct the condition for handle related function
spm_get_handle_by_client_handle is only used in an established connection, while tfm_spm_validate_conn_handle is used for both connection and non-connection. Change-Id: I614e7a009e750cd78c4759340b1f0d8ca7fca461 Signed-off-by: Summer Qin <[email protected]>
1 parent 853a547 commit 401cf81

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

secure_fw/spm/cmsis_psa/spm_ipc.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ struct conn_handle_t *tfm_spm_create_conn_handle(void)
164164
return p_handle;
165165
}
166166

167-
#if CONFIG_TFM_CONNECTION_BASED_SERVICE_API == 1
168167
int32_t tfm_spm_validate_conn_handle(const struct conn_handle_t *conn_handle)
169168
{
170169
/* Check the handle address is valid */
@@ -175,7 +174,6 @@ int32_t tfm_spm_validate_conn_handle(const struct conn_handle_t *conn_handle)
175174

176175
return SPM_SUCCESS;
177176
}
178-
#endif
179177

180178
int32_t tfm_spm_free_conn_handle(struct conn_handle_t *conn_handle)
181179
{
@@ -324,7 +322,7 @@ int32_t tfm_spm_check_authorization(uint32_t sid,
324322
}
325323

326324
/* Message functions */
327-
325+
#if CONFIG_TFM_CONNECTION_BASED_SERVICE_API == 1
328326
struct conn_handle_t *spm_get_handle_by_client_handle(psa_handle_t handle,
329327
int32_t client_id)
330328
{
@@ -341,6 +339,7 @@ struct conn_handle_t *spm_get_handle_by_client_handle(psa_handle_t handle,
341339

342340
return p_conn_handle;
343341
}
342+
#endif
344343

345344
struct conn_handle_t *spm_get_handle_by_msg_handle(psa_handle_t msg_handle)
346345
{

secure_fw/spm/cmsis_psa/spm_ipc.h

+2
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ struct service_t *tfm_spm_get_service_by_sid(uint32_t sid);
226226

227227
/************************ Message functions **********************************/
228228

229+
#if CONFIG_TFM_CONNECTION_BASED_SERVICE_API == 1
229230
/**
230231
* \brief Convert the given client handle to SPM recognised
231232
* handle and verify it.
@@ -239,6 +240,7 @@ struct service_t *tfm_spm_get_service_by_sid(uint32_t sid);
239240
*/
240241
struct conn_handle_t *spm_get_handle_by_client_handle(psa_handle_t handle,
241242
int32_t client_id);
243+
#endif
242244

243245
/**
244246
* \brief Convert the given message handle to SPM recognised

0 commit comments

Comments
 (0)