Skip to content

Commit

Permalink
Bluetooth: audio: has: Fix missing memset of parameters
Browse files Browse the repository at this point in the history
This fixes missing memset of parameters used for indications and/or
notifications.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
  • Loading branch information
MariuszSkamra committed Oct 16, 2023
1 parent 0146f8d commit 8087ca0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions subsys/bluetooth/audio/has.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ static int control_point_send(struct has_client *client, struct net_buf_simple *
#if defined(CONFIG_BT_HAS_PRESET_CONTROL_POINT_NOTIFIABLE)
if (bt_eatt_count(client->conn) > 0 &&
bt_gatt_is_subscribed(client->conn, preset_control_point_attr, BT_GATT_CCC_NOTIFY)) {
memset(&client->params.ntf, 0, sizeof(client->params.ntf));
client->params.ntf.attr = preset_control_point_attr;
client->params.ntf.func = control_point_ntf_complete;
client->params.ntf.data = buf->data;
Expand All @@ -737,6 +738,7 @@ static int control_point_send(struct has_client *client, struct net_buf_simple *
#endif /* CONFIG_BT_HAS_PRESET_CONTROL_POINT_NOTIFIABLE */

if (bt_gatt_is_subscribed(client->conn, preset_control_point_attr, BT_GATT_CCC_INDICATE)) {
memset(&client->params.ind, 0, sizeof(client->params.ind));
client->params.ind.attr = preset_control_point_attr;
client->params.ind.func = control_point_ind_complete;
client->params.ind.destroy = NULL;
Expand Down

0 comments on commit 8087ca0

Please sign in to comment.