diff --git a/services/bluetooth_standard/stack/src/gap/gap_br_sec.c b/services/bluetooth_standard/stack/src/gap/gap_br_sec.c index 5b9b814dff5fddc49c21beb15db76380807ee220..ab9a3e56072e13f30c1ed80a53582517178b29ae 100644 --- a/services/bluetooth_standard/stack/src/gap/gap_br_sec.c +++ b/services/bluetooth_standard/stack/src/gap/gap_br_sec.c @@ -1637,8 +1637,8 @@ void GapOnEncryptionChangeEvent(const HciEncryptionChangeEventParam *eventParam) } else { GapUpdateSecurityRequest(devInfo, GAP_SEC_EVENT_ENC_FAILED, eventParam->status); } - if (devInfo->status == GAP_DEV_SEC_STATUS_ACTION && devInfo->actionReq->status != GAP_SEC_REQ_STATUS_ACTION) { - devInfo->actionReq = NULL; + devInfo->actionReq = NULL; + if (devInfo->status == GAP_DEV_SEC_STATUS_ACTION) { devInfo->status = GAP_DEV_SEC_STATUS_WAIT_DISC; } }