瀏覽代碼

Bluetooth: hci_uart: Fix uninitialized alignment value

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>
Loic Poulain 8 年之前
父節點
當前提交
fb776481c4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/bluetooth/hci_h4.c

+ 1 - 1
drivers/bluetooth/hci_h4.c

@@ -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;