bluetooth: ias: Fix dereferencing before NULL check
It does make sense to dereference after NULL check. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
parent
4d2914c5c2
commit
33b0c0db38
1 changed files with 3 additions and 1 deletions
|
@ -96,7 +96,7 @@ static uint8_t bt_ias_alert_lvl_disc_cb(struct bt_conn *conn,
|
||||||
const struct bt_gatt_attr *attr,
|
const struct bt_gatt_attr *attr,
|
||||||
struct bt_gatt_discover_params *discover)
|
struct bt_gatt_discover_params *discover)
|
||||||
{
|
{
|
||||||
const struct bt_gatt_chrc *chrc = (struct bt_gatt_chrc *)attr->user_data;
|
const struct bt_gatt_chrc *chrc;
|
||||||
|
|
||||||
atomic_clear_bit(client_by_conn(conn)->flags, IAS_DISCOVER_IN_PROGRESS);
|
atomic_clear_bit(client_by_conn(conn)->flags, IAS_DISCOVER_IN_PROGRESS);
|
||||||
|
|
||||||
|
@ -106,6 +106,8 @@ static uint8_t bt_ias_alert_lvl_disc_cb(struct bt_conn *conn,
|
||||||
return BT_GATT_ITER_STOP;
|
return BT_GATT_ITER_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
chrc = (struct bt_gatt_chrc *)attr->user_data;
|
||||||
|
|
||||||
client_by_conn(conn)->alert_level_handle = chrc->value_handle;
|
client_by_conn(conn)->alert_level_handle = chrc->value_handle;
|
||||||
discover_complete(conn, 0);
|
discover_complete(conn, 0);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue