Merge branch 'bugfix/spp_deinit_v5.4' into 'release/v5.4'

fix(bt/bluedroid): flushed all the DM PM at the end of SPP deinit (v5.4)

See merge request espressif/esp-idf!47291
This commit is contained in:
Wang Meng Yang
2026-04-20 09:30:00 +08:00
2 changed files with 14 additions and 6 deletions
@@ -748,7 +748,20 @@ void bta_jv_disable (tBTA_JV_MSG *p_data)
{
tBTA_JV_STATUS evt_data;
evt_data = BTA_JV_SUCCESS;
// UNUSED(p_data);
// clear all the pm_cb slots
for (int i = 0; i < BTA_JV_PM_MAX_NUM; i++) {
if (bta_jv_cb.pm_cb[i].state != BTA_JV_PM_FREE_ST) {
bta_jv_clear_pm_cb(&bta_jv_cb.pm_cb[i], TRUE);
}
}
// reset the control block
memset(&bta_jv_cb, 0, sizeof(tBTA_JV_CB));
for (int i = 0; i < BTA_JV_PM_MAX_NUM; i++) {
bta_jv_cb.pm_cb[i].handle = BTA_JV_PM_HANDLE_CLEAR;
}
if (p_data->disable.p_cback) {
p_data->disable.p_cback(BTA_JV_DISABLE_EVT, (tBTA_JV *)&evt_data, NULL);
}
@@ -118,11 +118,6 @@ void BTA_JvDisable(tBTA_JV_RFCOMM_CBACK *p_cback)
APPL_TRACE_API( "BTA_JvDisable");
bta_sys_deregister(BTA_ID_JV);
memset(&bta_jv_cb, 0, sizeof(tBTA_JV_CB));
/* set handle to invalid value by default */
for (int i = 0; i < BTA_JV_PM_MAX_NUM; i++) {
bta_jv_cb.pm_cb[i].handle = BTA_JV_PM_HANDLE_CLEAR;
}
if ((p_buf = (tBTA_JV_API_DISABLE *) osi_malloc(sizeof(tBTA_JV_API_DISABLE))) != NULL) {
p_buf->hdr.event = BTA_JV_API_DISABLE_EVT;
p_buf->p_cback = p_cback;