Skip to content

Commit 1e02dd0

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: Audio: Add conn check for the VOCS client notify handler
Add a NULL check for the conn pointer. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 964df6d commit 1e02dd0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

subsys/bluetooth/audio/vocs_client.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ uint8_t vocs_client_notify_handler(struct bt_conn *conn, struct bt_gatt_subscrib
4949
const void *data, uint16_t length)
5050
{
5151
uint16_t handle = params->value_handle;
52-
struct bt_vocs *inst = lookup_vocs_by_handle(conn, handle);
52+
struct bt_vocs *inst;
53+
54+
if (conn == NULL) {
55+
return BT_GATT_ITER_CONTINUE;
56+
}
57+
58+
inst = lookup_vocs_by_handle(conn, handle);
5359

5460
if (!inst) {
5561
BT_DBG("Instance not found");

0 commit comments

Comments
 (0)