The code for updating the HCI_CONNECTABLE flag was incorrectly using
test_and_set_bit instead of test_and_clear_bit when HCI_CONNECTABLE is
to be cleared.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
changed = !test_and_set_bit(HCI_CONNECTABLE,
&hdev->dev_flags);
else
- changed = test_and_set_bit(HCI_CONNECTABLE,
- &hdev->dev_flags);
+ changed = test_and_clear_bit(HCI_CONNECTABLE,
+ &hdev->dev_flags);
if (changed)
mgmt_new_settings(hdev);