components/bt: Fix crash in BTM_SetPowerMode after disconnect

Introduced by commit 0583a049
pull/5682/merge
baohongde 2020-09-22 21:07:14 +08:00 zatwierdzone przez xiongweichao
rodzic ecd75ec652
commit dac798afbb
1 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -194,6 +194,10 @@ tBTM_STATUS BTM_SetPowerMode (UINT8 pm_id, BD_ADDR remote_bda, tBTM_PM_PWR_MD *p
mode = p_mode->mode & ~BTM_PM_MD_FORCE;
p_acl_cb = btm_bda_to_acl(remote_bda, BT_TRANSPORT_BR_EDR);
if (p_acl_cb == NULL){
return BTM_UNKNOWN_ADDR;
}
p_cb = p_acl_cb->p_pm_mode_db;
if (mode != BTM_PM_MD_ACTIVE) {
/* check if the requested mode is supported */