Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db99b5fc authored by Johan Hedberg's avatar Johan Hedberg
Browse files

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: default avatarJohan Hedberg <johan.hedberg@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 490c5bab
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -227,6 +227,7 @@ static void hci_cc_read_local_name(struct hci_dev *hdev, struct sk_buff *skb)
	if (rp->status)
	if (rp->status)
		return;
		return;


	if (test_bit(HCI_SETUP, &hdev->dev_flags))
		memcpy(hdev->dev_name, rp->name, HCI_MAX_NAME_LENGTH);
		memcpy(hdev->dev_name, rp->name, HCI_MAX_NAME_LENGTH);
}
}