OSDN Git Service

Bluetooth: btusb: Fix application of sizeof to pointer
authorDavid Yang <davidcomponentone@gmail.com>
Wed, 13 Oct 2021 00:56:33 +0000 (08:56 +0800)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 13 Oct 2021 06:36:51 +0000 (08:36 +0200)
The coccinelle check report:
"./drivers/bluetooth/btusb.c:2239:36-42:
ERROR: application of sizeof to pointer".
Using the real size to fix it.

Fixes: 5a87679ffd443 ("Bluetooth: btusb: Support public address configuration for MediaTek Chip.")
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btusb.c

index 75c8376..3e26f60 100644 (file)
@@ -2236,7 +2236,7 @@ static int btusb_set_bdaddr_mtk(struct hci_dev *hdev, const bdaddr_t *bdaddr)
        struct sk_buff *skb;
        long ret;
 
-       skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(bdaddr), bdaddr, HCI_INIT_TIMEOUT);
+       skb = __hci_cmd_sync(hdev, 0xfc1a, 6, bdaddr, HCI_INIT_TIMEOUT);
        if (IS_ERR(skb)) {
                ret = PTR_ERR(skb);
                bt_dev_err(hdev, "changing Mediatek device address failed (%ld)",