Bluetooth: Fix missing checks for the BT_DEV_READY flag

Several public APIs were not checking the BT_DEV_READY flag, which
could lead to hard-to-debug behavior, particularly when the stack
lacks an identity address. Add the appropriate checks to these APIs.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2019-03-22 12:48:32 +02:00 committed by Johan Hedberg
commit f811e5446a
2 changed files with 12 additions and 0 deletions

View file

@ -1919,6 +1919,10 @@ struct bt_conn *bt_conn_create_le(const bt_addr_le_t *peer,
{
struct bt_conn *conn;
if (!atomic_test_bit(bt_dev.flags, BT_DEV_READY)) {
return NULL;
}
if (!bt_le_conn_params_valid(param)) {
return NULL;
}