822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch 1.1 KB

1234567891011121314151617181920212223242526272829
  1. From af774a731f7b4c2a90a8476cd44045ba8d1263ba Mon Sep 17 00:00:00 2001
  2. From: David Yang <[email protected]>
  3. Date: Wed, 13 Oct 2021 08:56:33 +0800
  4. Subject: [PATCH 2/5] Bluetooth: btusb: Fix application of sizeof to pointer
  5. The coccinelle check report:
  6. "./drivers/bluetooth/btusb.c:2239:36-42:
  7. ERROR: application of sizeof to pointer".
  8. Using the real size to fix it.
  9. Fixes: 5a87679ffd443 ("Bluetooth: btusb: Support public address configuration for MediaTek Chip.")
  10. Reported-by: Zeal Robot <[email protected]>
  11. Signed-off-by: David Yang <[email protected]>
  12. Signed-off-by: Marcel Holtmann <[email protected]>
  13. ---
  14. drivers/bluetooth/btusb.c | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. --- a/drivers/bluetooth/btusb.c
  17. +++ b/drivers/bluetooth/btusb.c
  18. @@ -2277,7 +2277,7 @@ static int btusb_set_bdaddr_mtk(struct h
  19. struct sk_buff *skb;
  20. long ret;
  21. - skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(bdaddr), bdaddr, HCI_INIT_TIMEOUT);
  22. + skb = __hci_cmd_sync(hdev, 0xfc1a, 6, bdaddr, HCI_INIT_TIMEOUT);
  23. if (IS_ERR(skb)) {
  24. ret = PTR_ERR(skb);
  25. bt_dev_err(hdev, "changing Mediatek device address failed (%ld)",