Skip to content

Commit

Permalink
Bluetooth: mgmt: Fix current settings values when powered off
Browse files Browse the repository at this point in the history
We should not stop iterating through the various settings if powered off
since most may still be set even then.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Johan Hedberg committed Feb 21, 2012
1 parent df2c6c5 commit f1f0eb0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,7 @@ static u32 get_current_settings(struct hci_dev *hdev)
{
u32 settings = 0;

if (!test_bit(HCI_UP, &hdev->flags))
return settings;

if (!test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
if (hdev_is_powered(hdev))
settings |= MGMT_SETTING_POWERED;

if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags))
Expand Down

0 comments on commit f1f0eb0

Please sign in to comment.