Bluetooth: Fix using test_and_clear instead of test_and_set
Subsystems (2)
PATCH 1/1 Bluetooth: Fix using test_and_clear instead of test_and_set
From: Johan Hedberg <[email protected]>
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 <[email protected]>
--- net/bluetooth/hci_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/bluetooth/hci_core.c +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);
Signature · 1 line
1.9.3
Marcel Holtmann
maintainerHi Johan,
Quoted 8 lines
The code for updating the
HCI_CONNECTABLEflag was incorrectly usingtest_and_set_bitinstead oftest_and_clear_bitwhenHCI_CONNECTABLEis to be cleared.Signed-off-by Johan Hedberg <[email protected]>---
net/bluetooth/hci_core.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel