summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/bluetooth/hci_core.h2
-rw-r--r--net/bluetooth/mgmt.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 92b2148..cd2682c 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -507,6 +507,8 @@ extern struct mutex hci_cb_list_lock;
#define hci_dev_change_flag(hdev, nr) change_bit((nr), &(hdev)->dev_flags)
#define hci_dev_test_flag(hdev, nr) test_bit((nr), &(hdev)->dev_flags)
+#define hci_dev_test_and_change_flag(hdev, nr) test_and_change_bit((nr), &(hdev)->dev_flags)
+
/* ----- HCI interface to upper protocols ----- */
int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr);
int l2cap_disconn_ind(struct hci_conn *hcon);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index c3af3b8..3c579a4 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -6102,7 +6102,7 @@ static int set_external_config(struct sock *sk, struct hci_dev *hdev,
if (hci_dev_test_flag(hdev, HCI_UNCONFIGURED) == is_configured(hdev)) {
mgmt_index_removed(hdev);
- if (test_and_change_bit(HCI_UNCONFIGURED, &hdev->dev_flags)) {
+ if (hci_dev_test_and_change_flag(hdev, HCI_UNCONFIGURED)) {
hci_dev_set_flag(hdev, HCI_CONFIG);
hci_dev_set_flag(hdev, HCI_AUTO_OFF);
OpenPOWER on IntegriCloud