Skip to content

Commit

Permalink
Bluetooth: mgmt: Check for HCI_UP in update_eir() and update_class()
Browse files Browse the repository at this point in the history
These functions should just silently fail when we're not powered on
instead of trying to send HCI commands.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Johan Hedberg committed Feb 23, 2012
1 parent 8ec3703 commit 7770c4a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 7770c4a

Please sign in to comment.