Commit 7770c4aa authored by Johan Hedberg's avatar Johan Hedberg

Bluetooth: mgmt: Check for HCI_UP in update_eir() and update_class()

These functions should just silently fail when we're not powered on
instead of trying to send HCI commands.
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 8ec37034
......@@ -532,6 +532,9 @@ static int update_eir(struct hci_dev *hdev)
{
struct hci_cp_write_eir cp;
if (!test_bit(HCI_UP, &hdev->flags))
return 0;
if (!(hdev->features[6] & LMP_EXT_INQ))
return 0;
......@@ -570,6 +573,9 @@ static int update_class(struct hci_dev *hdev)
BT_DBG("%s", hdev->name);
if (!test_bit(HCI_UP, &hdev->flags))
return 0;
if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment