Skip to content

Commit

Permalink
Bluetooth: Audio: Add conn check for the VOCS client notify handler
Browse files Browse the repository at this point in the history
Add a NULL check for the conn pointer.

Signed-off-by: Emil Gydesen <[email protected]>
  • Loading branch information
Thalley authored and carlescufi committed Apr 27, 2022
1 parent 964df6d commit 1e02dd0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion subsys/bluetooth/audio/vocs_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ uint8_t vocs_client_notify_handler(struct bt_conn *conn, struct bt_gatt_subscrib
const void *data, uint16_t length)
{
uint16_t handle = params->value_handle;
struct bt_vocs *inst = lookup_vocs_by_handle(conn, handle);
struct bt_vocs *inst;

if (conn == NULL) {
return BT_GATT_ITER_CONTINUE;
}

inst = lookup_vocs_by_handle(conn, handle);

if (!inst) {
BT_DBG("Instance not found");
Expand Down

0 comments on commit 1e02dd0

Please sign in to comment.