no need to ask for encryption after pairing, fold deref under the null check

pull/6188/head
paul-szczepanek-arm 2018-03-01 17:47:18 +00:00
parent e706b41ccf
commit 68f25611d5
1 changed files with 2 additions and 6 deletions

View File

@ -900,14 +900,10 @@ void GenericSecurityManager::on_pairing_timed_out(connection_handle_t connection
void GenericSecurityManager::on_pairing_completed(connection_handle_t connection) {
ControlBlock_t *cb = get_control_block(connection);
if (cb) {
if (cb->encryption_requested) {
enable_encryption(connection);
}
// set the distribution flags in the db
_db.set_distribution_flags(cb->db_entry, *cb);
}
// set the distribution flags in the db
_db.set_distribution_flags(cb->db_entry, *cb);
eventHandler->pairingResult(
connection,
SecurityManager::SEC_STATUS_SUCCESS