Bluetooth: GATT: Fix not updating previous node

When iterating to the subscriptions to be removed the code has to keep
a reference to the previous node but it case the subscription matches but
doesn't need to be removed it doesn't update the prev node which may
corrupt the list in case the next node end up being removed.

Change-Id: Ic5448f01bf78d293f93b9a7078a0147385ea1d23
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2017-02-09 11:27:23 +02:00 committed by Johan Hedberg
commit 92e8d91332

View file

@ -765,6 +765,7 @@ static void remove_subscriptions(struct bt_conn *conn)
gatt_subscription_remove(conn, prev, params);
} else {
update_subscription(conn, params);
prev = node;
}
}
}