Bluetooth: mediatek: pass correct size to h4_recv_buf()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 13 Aug 2018 09:32:35 +0000 (12:32 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 13 Aug 2018 13:59:39 +0000 (15:59 +0200)
We're supposed to pass the number of elements in the mtk_recv_pkts, not
the number of bytes.

Fixes: 7237c4c9ec92 ("Bluetooth: mediatek: Add protocol support for MediaTek serial devices")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btmtkuart.c

index e0571fe04d007d4c48f4d0d6dc9b51cfc623f186..ed2a5c7cb77fa0304ed7f3639631c3b9c8eb597e 100644 (file)
@@ -346,7 +346,7 @@ static int btmtkuart_recv(struct hci_dev *hdev, const u8 *data, size_t count)
 
                bdev->rx_skb = h4_recv_buf(bdev->hdev, bdev->rx_skb, p_h4,
                                           sz_h4, mtk_recv_pkts,
-                                          sizeof(mtk_recv_pkts));
+                                          ARRAY_SIZE(mtk_recv_pkts));
                if (IS_ERR(bdev->rx_skb)) {
                        err = PTR_ERR(bdev->rx_skb);
                        bt_dev_err(bdev->hdev,