Bluetooth: Fix advertising duplicated flags
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Sun, 3 Nov 2019 21:58:15 +0000 (23:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:35:34 +0000 (16:35 +0100)
commiteef455a9b57793d65867a3b20e16db5cf23a6fea
treef865582d997433fb7faf29244d933b80aafeec1a
parentb3051cd82d92dda7e247c116b953bcdc0779e4e4
Bluetooth: Fix advertising duplicated flags

[ Upstream commit 6012b9346d8959194c239fd60a62dfec98d43048 ]

Instances may have flags set as part of its data in which case the code
should not attempt to add it again otherwise it can cause duplication:

< HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 35
        Handle: 0x00
        Operation: Complete extended advertising data (0x03)
        Fragment preference: Minimize fragmentation (0x01)
        Data length: 0x06
        Flags: 0x04
          BR/EDR Not Supported
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/hci_request.c