Skip to content

Commit 50ccf86

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: Audio: Add conn check for AICS client nofity handler
Add a NULL check for the conn pointer in the AICS client instance. Signed-off-by: Emil Gydesen <[email protected]>
1 parent dd5119f commit 50ccf86

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

subsys/bluetooth/audio/aics_client.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,16 @@ uint8_t aics_client_notify_handler(struct bt_conn *conn, struct bt_gatt_subscrib
5151
const void *data, uint16_t length)
5252
{
5353
uint16_t handle = params->value_handle;
54-
struct bt_aics *inst = lookup_aics_by_handle(conn, handle);
54+
struct bt_aics *inst;
5555
struct bt_aics_state *state;
5656
uint8_t *status;
5757

58+
if (conn == NULL) {
59+
return BT_GATT_ITER_CONTINUE;
60+
}
61+
62+
inst = lookup_aics_by_handle(conn, handle);
63+
5864
if (!inst) {
5965
BT_DBG("Instance not found");
6066
return BT_GATT_ITER_STOP;

0 commit comments

Comments
 (0)