diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 195aea2198a9..266cf03156d4 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2621,7 +2621,9 @@ int hci_register_dev(struct hci_dev *hdev) if (error) return error; + printk("%p, %d, %s\n", hdev->name, sizeof(hdev->name), __func__); hdev->name = dev_name(&hdev->dev); + printk("%p, %d, %s, %s\n", hdev->name, sizeof(hdev->name), hdev->name, __func__); hdev->id = id; BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 5e4f718073b7..50658e303655 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -477,6 +477,7 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event) struct hci_mon_index_info *ii; struct sk_buff *skb; __le16 opcode; + size_t sn, hn; switch (event) { case HCI_DEV_REG: @@ -488,7 +489,11 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event) ni->type = hdev->dev_type; ni->bus = hdev->bus; bacpy(&ni->bdaddr, &hdev->bdaddr); - memcpy(ni->name, hdev->name, 8); + sn = strlen(ni->name); + hn = strlen(hdev->name); + printk("%d, %d, %s, %p\n", sn, hn, __func__, hdev->name); + sn = sn > hn ? hn : sn; + memcpy(ni->name, hdev->name, hn); opcode = cpu_to_le16(HCI_MON_NEW_INDEX); break;