bluetooth: fix removal of needed subscriptions

Providing 'tmp', which was never updated, resulted in removeal of
subscriptions from the beginning.
Using the updated 'prev' resolves this.

Signed-off-by: Marco Sterbik <madbadmax00@gmail.com>
This commit is contained in:
Marco Sterbik 2019-12-13 13:14:40 +01:00 committed by Johan Hedberg
commit 9217c6634e

View file

@ -3425,7 +3425,7 @@ static void gatt_write_ccc_rsp(struct bt_conn *conn, u8_t err,
SYS_SLIST_FOR_EACH_NODE_SAFE(&subscriptions, node, tmp) {
if (node == &params->node) {
gatt_subscription_remove(conn, tmp, params);
gatt_subscription_remove(conn, prev, params);
break;
}