Bluetooth: host: Fix handling of scan start failed
Handle scan start failed and release the connection object in this case. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
abd03aa3ad
commit
794cbd641b
1 changed files with 6 additions and 1 deletions
|
@ -2253,7 +2253,12 @@ struct bt_conn *bt_conn_create_le(const bt_addr_le_t *peer,
|
|||
if (!bt_dev.le.rl_size || bt_dev.le.rl_entries > bt_dev.le.rl_size) {
|
||||
bt_conn_set_state(conn, BT_CONN_CONNECT_SCAN);
|
||||
|
||||
bt_le_scan_update(true);
|
||||
if (bt_le_scan_update(true)) {
|
||||
bt_conn_set_state(conn, BT_CONN_DISCONNECTED);
|
||||
bt_conn_unref(conn);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return conn;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue