diff options
author | David Lechner <david@lechnology.com> | 2017-12-07 20:22:19 -0600 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2017-12-13 00:28:41 +0100 |
commit | c30b93eade2ad1d77695669f25ddeb3833588d3b (patch) | |
tree | d452b17e4d44bd526e33dfe84a47abc436fe89a2 /drivers/bluetooth | |
parent | 7c6ca1201e5e87513b27196138f06df9cbd09a7a (diff) | |
download | talos-op-linux-c30b93eade2ad1d77695669f25ddeb3833588d3b.tar.gz talos-op-linux-c30b93eade2ad1d77695669f25ddeb3833588d3b.zip |
Bluetooth: hci_ll: Add endianness conversion when setting baudrate
This adds an endianness conversion when setting the baudrate using a
vendor-specific command. Otherwise, bad things might happen on a big-
endian system.
Suggested-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: David Lechner <david@lechnology.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r-- | drivers/bluetooth/hci_ll.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c index 974a78879d20..efcfbe9aac21 100644 --- a/drivers/bluetooth/hci_ll.c +++ b/drivers/bluetooth/hci_ll.c @@ -707,10 +707,12 @@ static int ll_setup(struct hci_uart *hu) speed = 0; if (speed) { + __le32 speed_le = cpu_to_le32(speed); struct sk_buff *skb; skb = __hci_cmd_sync(hu->hdev, HCI_VS_UPDATE_UART_HCI_BAUDRATE, - sizeof(speed), &speed, HCI_INIT_TIMEOUT); + sizeof(speed_le), &speed_le, + HCI_INIT_TIMEOUT); if (!IS_ERR(skb)) { kfree_skb(skb); serdev_device_set_baudrate(serdev, speed); |