aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_event.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-02-22 13:14:22 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-23 06:07:00 -0500
commitdb99b5fc77e6cec47d80703b471f1efe04527d2f (patch)
tree9230d4104b45ab1717bb63d46d1cd56438eac4e1 /net/bluetooth/hci_event.c
parent490c5baba7a5ad80782d5eb778638d1cfc8d70ce (diff)
Bluetooth: Fix read_name updating when HCI_SETUP is not set
The local name should only be updated as a consequence of a hci_read_local_name if we are in the HCI_SETUP state. In all other scenarios it should only be updated through hci_write_local_name. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r--net/bluetooth/hci_event.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index c79ffb955554..9917fe3d1d18 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -227,7 +227,8 @@ static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb)
227 if (rp->status) 227 if (rp->status)
228 return; 228 return;
229 229
230 memcpy(hdev->dev_name, rp->name, HCI_MAX_NAME_LENGTH); 230 if (test_bit(HCI_SETUP, &hdev->dev_flags))
231 memcpy(hdev->dev_name, rp->name, HCI_MAX_NAME_LENGTH);
231} 232}
232 233
233static void hci_cc_write_auth_enable(struct hci_dev *hdev, struct sk_buff *skb) 234static void hci_cc_write_auth_enable(struct hci_dev *hdev, struct sk_buff *skb)