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:
parent
12a413779d
commit
f811e5446a
2 changed files with 12 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue