From: Johan Hedberg Date: Sat, 26 Jan 2013 22:31:27 +0000 (+0200) Subject: Bluetooth: Store UUIDs in the same order that they were added X-Git-Tag: accepted/tizen/common/20141203.182822~2855^2~31^2^2~102^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=de66aa63054a6fe348869722221d5cd3463d74a0;p=platform%2Fkernel%2Flinux-arm64.git Bluetooth: Store UUIDs in the same order that they were added We should be encoding UUIDs to the EIR data in the same order that they were added to the kernel, i.e. each UUID should be added to the end of the UUIDs list. This patch fixes the issue by using list_add_tail instead of list_add for storing the UUIDs. Signed-off-by: Johan Hedberg Acked-by: Marcel Holtmann Signed-off-by: Gustavo Padovan --- diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index e7f944f..4fd45a3 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1330,7 +1330,7 @@ static int add_uuid(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) memcpy(uuid->uuid, cp->uuid, 16); uuid->svc_hint = cp->svc_hint; - list_add(&uuid->list, &hdev->uuids); + list_add_tail(&uuid->list, &hdev->uuids); err = update_class(hdev); if (err < 0)