mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
Merge branch 'bugfix/fixed_ble_deinit_crash_issue_5.5' into 'release/v5.5'
fix(bt): fixed mempool deinit crash issue See merge request espressif/esp-idf!52142
This commit is contained in:
@@ -34,7 +34,7 @@ function(register_bt_ctrl_libs)
|
||||
set(lib_path "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/lib_${TARGET_SRC_NAME}/${TARGET_SRC_NAME}-bt-lib")
|
||||
# BLE controller library
|
||||
if(NOT CONFIG_BT_DUAL_MODE_ARCH OR CONFIG_BT_CTRL_BLE_ENABLE)
|
||||
if(EXISTS "${lib_path}/libble_app.a")
|
||||
if(NOT EXISTS "${lib_path}/${idf_target}")
|
||||
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY AND EXISTS "${lib_path}/libble_app_flash.a")
|
||||
add_prebuilt_library(libble_app "${lib_path}/libble_app_flash.a" REQUIRES esp_phy bt)
|
||||
else()
|
||||
|
||||
Submodule components/bt/host/nimble/nimble updated: 96ab0e4d86...8d18f6d4ac
@@ -358,6 +358,29 @@ void os_mempool_flags_set(struct os_mempool *mp, uint8_t flags);
|
||||
*/
|
||||
void os_mempool_flags_clear(struct os_mempool *mp, uint8_t flags);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize a memory pool.
|
||||
*
|
||||
* @param mp Pointer to memory pool
|
||||
*/
|
||||
void os_mempool_deinit(struct os_mempool *mp);
|
||||
|
||||
/**
|
||||
* @brief Deinitialize all of memory pools.
|
||||
*
|
||||
* @param is_controller Whether called from controller.
|
||||
*
|
||||
* @return OS_OK on success; OS_INVALID_PARM if not found corresponding memory pools.
|
||||
*/
|
||||
os_error_t os_mempool_deinit_all(bool is_controller);
|
||||
|
||||
/**
|
||||
* @brief Check if there are any live memory pools.
|
||||
*
|
||||
* @return true if there are any live memory pools; false otherwise.
|
||||
*/
|
||||
bool os_mempool_has_live_pool(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -735,6 +735,11 @@ os_mempool_module_init(void)
|
||||
static os_error_t
|
||||
os_mempool_mem_free(struct os_mempool *mp)
|
||||
{
|
||||
/* Extended mempool has its own free logic */
|
||||
if (mp->mp_flags & OS_MEMPOOL_F_EXT) {
|
||||
return OS_OK;
|
||||
}
|
||||
|
||||
/* For runtime allocation mode, check whether all blocks have been freed */
|
||||
if (!(mp->mp_flags & OS_MEMPOOL_F_RUNTIME)) {
|
||||
return OS_EINVAL;
|
||||
@@ -767,8 +772,15 @@ os_mempool_mem_free(struct os_mempool *mp)
|
||||
#endif
|
||||
|
||||
void
|
||||
os_mempool_deinit(bool is_controller)
|
||||
os_mempool_deinit(struct os_mempool *mp)
|
||||
{
|
||||
os_mempool_unregister(mp);
|
||||
}
|
||||
|
||||
os_error_t
|
||||
os_mempool_deinit_all(bool is_controller)
|
||||
{
|
||||
os_error_t err = OS_INVALID_PARM;
|
||||
struct os_mempool *mp = NULL;
|
||||
struct os_mempool *next = NULL;
|
||||
|
||||
@@ -780,8 +792,17 @@ os_mempool_deinit(bool is_controller)
|
||||
next = STAILQ_NEXT(mp, mp_list);
|
||||
os_mempool_unregister(mp);
|
||||
mp = next;
|
||||
err = OS_OK;
|
||||
} else {
|
||||
mp = STAILQ_NEXT(mp, mp_list);
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
bool
|
||||
os_mempool_has_live_pool(void)
|
||||
{
|
||||
return !STAILQ_EMPTY(&g_os_mempool_list);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user