]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Bluetooth: hci_uart: Fix uninitialized alignment value
authorLoic Poulain <loic.poulain@gmail.com>
Sat, 29 Jul 2017 17:32:31 +0000 (19:32 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 31 Jul 2017 10:27:37 +0000 (13:27 +0300)
Force alignment value to the default one (1 byte) if uninitialized.
This fixes hci_ll serdev driver (alignment = 0) and avoid any further
issues with upcoming drivers.

Signed-off-by: Loic Poulain <loic.poulain@gmail.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
drivers/bluetooth/hci_h4.c

index 4e328d7d47bb3cfed9e9d8c5dc323c6388fa8ff8..3b82a87224a941dc619d0493127015b5528f29e8 100644 (file)
@@ -172,7 +172,7 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
                            const struct h4_recv_pkt *pkts, int pkts_count)
 {
        struct hci_uart *hu = hci_get_drvdata(hdev);
-       u8 alignment = hu->alignment;
+       u8 alignment = hu->alignment ? hu->alignment : 1;
 
        while (count) {
                int i, len;