aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-02-22 15:06:38 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-23 06:07:01 -0500
commit7770c4aacaf34fb69cb2acfb7469e9b4e34f1674 (patch)
tree98c0ab7916a0dae04b2c1317ff44bf16452a88f5 /net/bluetooth/mgmt.c
parent8ec37034ef36b89cfb060bd9273db24e6acb1b3a (diff)
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: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 23421f05abf2..3a2066504ffe 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -532,6 +532,9 @@ static int update_eir(struct hci_dev *hdev)
532{ 532{
533 struct hci_cp_write_eir cp; 533 struct hci_cp_write_eir cp;
534 534
535 if (!test_bit(HCI_UP, &hdev->flags))
536 return 0;
537
535 if (!(hdev->features[6] & LMP_EXT_INQ)) 538 if (!(hdev->features[6] & LMP_EXT_INQ))
536 return 0; 539 return 0;
537 540
@@ -570,6 +573,9 @@ static int update_class(struct hci_dev *hdev)
570 573
571 BT_DBG("%s", hdev->name); 574 BT_DBG("%s", hdev->name);
572 575
576 if (!test_bit(HCI_UP, &hdev->flags))
577 return 0;
578
573 if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags)) 579 if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
574 return 0; 580 return 0;
575 581