Skip to content

Commit 5dfea31

Browse files
Thalleycarlescufi
authored andcommitted
Bluetooth: Audio: Add conn check for CSIS client notify handlers
Add a NULL check for the conn pointer in the CSIS client notify handlers. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 50ccf86 commit 5dfea31

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

subsys/bluetooth/audio/csis_client.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ static uint8_t sirk_notify_func(struct bt_conn *conn,
186186
return BT_GATT_ITER_STOP;
187187
}
188188

189+
if (conn == NULL) {
190+
return BT_GATT_ITER_CONTINUE;
191+
}
192+
189193
csis_inst = lookup_instance_by_handle(conn, handle);
190194

191195
if (csis_inst != NULL) {
@@ -254,6 +258,10 @@ static uint8_t size_notify_func(struct bt_conn *conn,
254258
return BT_GATT_ITER_STOP;
255259
}
256260

261+
if (conn == NULL) {
262+
return BT_GATT_ITER_CONTINUE;
263+
}
264+
257265
csis_inst = lookup_instance_by_handle(conn, handle);
258266

259267
if (csis_inst != NULL) {
@@ -297,6 +305,10 @@ static uint8_t lock_notify_func(struct bt_conn *conn,
297305
return BT_GATT_ITER_STOP;
298306
}
299307

308+
if (conn == NULL) {
309+
return BT_GATT_ITER_CONTINUE;
310+
}
311+
300312
csis_inst = lookup_instance_by_handle(conn, handle);
301313

302314
if (csis_inst != NULL) {

0 commit comments

Comments
 (0)