change free to kmm_free as it was allocated via kmm_alloc

This commit is contained in:
Roy Feng 2023-07-05 13:26:21 +08:00 committed by Xiang Xiao
parent dc7f8f136c
commit 8f66b033db

View File

@ -255,8 +255,8 @@ int esp_himem_init(void)
if (g_ram_descriptor == NULL || g_range_descriptor == NULL) if (g_ram_descriptor == NULL || g_range_descriptor == NULL)
{ {
merr("Cannot allocate memory for meta info. Not initializing!"); merr("Cannot allocate memory for meta info. Not initializing!");
free(g_ram_descriptor); kmm_free(g_ram_descriptor);
free(g_range_descriptor); kmm_free(g_range_descriptor);
return -ENOMEM; return -ENOMEM;
} }
@ -358,8 +358,8 @@ int esp_himem_alloc(size_t size, esp_himem_handle_t *handle_out)
nomem: nomem:
if (r) if (r)
{ {
free(r->block); kmm_free(r->block);
free(r); kmm_free(r);
} }
return -ENOMEM; return -ENOMEM;
@ -390,8 +390,8 @@ int esp_himem_free(esp_himem_handle_t handle)
/* Free handle */ /* Free handle */
free(handle->block); kmm_free(handle->block);
free(handle); kmm_free(handle);
return OK; return OK;
} }
@ -448,7 +448,7 @@ int esp_himem_alloc_map_range(size_t size,
{ {
/* Couldn't find enough free blocks */ /* Couldn't find enough free blocks */
free(r); kmm_free(r);
spin_unlock_irqrestore(NULL, spinlock_flags); spin_unlock_irqrestore(NULL, spinlock_flags);
return -ENOMEM; return -ENOMEM;
} }
@ -497,7 +497,7 @@ int esp_himem_free_map_range(esp_himem_rangehandle_t handle)
} }
spin_unlock_irqrestore(NULL, spinlock_flags); spin_unlock_irqrestore(NULL, spinlock_flags);
free(handle); kmm_free(handle);
return OK; return OK;
} }