Bluetooth: Fix using test_and_clear instead of test_and_set

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>
This commit is contained in:
Johan Hedberg 2014-07-10 11:50:27 +03:00 коммит произвёл Marcel Holtmann
Родитель b3c6410b8c
Коммит 7fabc0f4c7
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -2726,8 +2726,8 @@ int hci_dev_cmd(unsigned int cmd, void __user *arg)
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);