From 8087ca06fff865053cbebea37c31863b034f67e2 Mon Sep 17 00:00:00 2001 From: Mariusz Skamra Date: Mon, 16 Oct 2023 15:20:49 +0200 Subject: [PATCH] Bluetooth: audio: has: Fix missing memset of parameters This fixes missing memset of parameters used for indications and/or notifications. Signed-off-by: Mariusz Skamra --- subsys/bluetooth/audio/has.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsys/bluetooth/audio/has.c b/subsys/bluetooth/audio/has.c index e73fecb26808720..103a61edcd29faa 100644 --- a/subsys/bluetooth/audio/has.c +++ b/subsys/bluetooth/audio/has.c @@ -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; @@ -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;