You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/07/05 08:40:29 UTC
[nuttx] branch master updated: change `free` to `kmm_free` as it was allocated via `kmm_alloc`
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 8f66b033db change `free` to `kmm_free` as it was allocated via `kmm_alloc`
8f66b033db is described below
commit 8f66b033db0b829e02175dfdb09a498ed1801fc2
Author: Roy Feng <ro...@sony.com>
AuthorDate: Wed Jul 5 13:26:21 2023 +0800
change `free` to `kmm_free` as it was allocated via `kmm_alloc`
---
arch/xtensa/src/esp32/esp32_himem.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/xtensa/src/esp32/esp32_himem.c b/arch/xtensa/src/esp32/esp32_himem.c
index 0c1035c150..5ede3dead3 100644
--- a/arch/xtensa/src/esp32/esp32_himem.c
+++ b/arch/xtensa/src/esp32/esp32_himem.c
@@ -255,8 +255,8 @@ int esp_himem_init(void)
if (g_ram_descriptor == NULL || g_range_descriptor == NULL)
{
merr("Cannot allocate memory for meta info. Not initializing!");
- free(g_ram_descriptor);
- free(g_range_descriptor);
+ kmm_free(g_ram_descriptor);
+ kmm_free(g_range_descriptor);
return -ENOMEM;
}
@@ -358,8 +358,8 @@ int esp_himem_alloc(size_t size, esp_himem_handle_t *handle_out)
nomem:
if (r)
{
- free(r->block);
- free(r);
+ kmm_free(r->block);
+ kmm_free(r);
}
return -ENOMEM;
@@ -390,8 +390,8 @@ int esp_himem_free(esp_himem_handle_t handle)
/* Free handle */
- free(handle->block);
- free(handle);
+ kmm_free(handle->block);
+ kmm_free(handle);
return OK;
}
@@ -448,7 +448,7 @@ int esp_himem_alloc_map_range(size_t size,
{
/* Couldn't find enough free blocks */
- free(r);
+ kmm_free(r);
spin_unlock_irqrestore(NULL, spinlock_flags);
return -ENOMEM;
}
@@ -497,7 +497,7 @@ int esp_himem_free_map_range(esp_himem_rangehandle_t handle)
}
spin_unlock_irqrestore(NULL, spinlock_flags);
- free(handle);
+ kmm_free(handle);
return OK;
}