We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 717935d commit 94a2d37Copy full SHA for 94a2d37
core/arch/arm/mm/tee_mmu.c
@@ -214,6 +214,7 @@ static TEE_Result tee_mmu_umap_set_vas(struct tee_mmu_info *mmu)
214
TEE_Result tee_mmu_init(struct user_ta_ctx *utc)
215
{
216
uint32_t asid = 1;
217
+ bool asid_allocated = false;
218
219
if (!utc->context) {
220
utc->context = 1;
@@ -229,11 +230,15 @@ TEE_Result tee_mmu_init(struct user_ta_ctx *utc)
229
230
return TEE_ERROR_GENERIC;
231
}
232
g_asid &= ~asid;
233
+ asid_allocated = true;
234
235
236
utc->mmu = calloc(1, sizeof(struct tee_mmu_info));
- if (!utc->mmu)
237
+ if (!utc->mmu) {
238
+ if (asid_allocated)
239
+ g_asid |= asid;
240
return TEE_ERROR_OUT_OF_MEMORY;
241
+ }
242
core_mmu_get_user_va_range(&utc->mmu->ta_private_vmem_start, NULL);
243
return TEE_SUCCESS;
244
0 commit comments