From: Johan Hedberg Date: Thu, 10 Jul 2014 08:50:27 +0000 (+0300) Subject: Bluetooth: Fix using test_and_clear instead of test_and_set X-Git-Tag: v3.17-rc1~106^2~73^2~42^2~32 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7fabc0f4c7bd2206c368a79e3ed79b7d36625cfd;p=karo-tx-linux.git 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 Signed-off-by: Marcel Holtmann --- diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 84431b86af96..8f9df768f250 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -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);