aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_core.c1
-rw-r--r--net/bluetooth/mgmt.c12
2 files changed, 11 insertions, 2 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 3c81b5cdda83..8b3f839ba826 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -4255,6 +4255,7 @@ void hci_unregister_dev(struct hci_dev *hdev)
4255 hci_remote_oob_data_clear(hdev); 4255 hci_remote_oob_data_clear(hdev);
4256 hci_bdaddr_list_clear(&hdev->le_white_list); 4256 hci_bdaddr_list_clear(&hdev->le_white_list);
4257 hci_conn_params_clear_all(hdev); 4257 hci_conn_params_clear_all(hdev);
4258 hci_discovery_filter_clear(hdev);
4258 hci_dev_unlock(hdev); 4259 hci_dev_unlock(hdev);
4259 4260
4260 hci_dev_put(hdev); 4261 hci_dev_put(hdev);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 104c4cc921da..74571a4b85ec 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3870,9 +3870,12 @@ static int start_discovery(struct sock *sk, struct hci_dev *hdev,
3870 goto failed; 3870 goto failed;
3871 } 3871 }
3872 3872
3873 /* Clear the discovery filter first to free any previously
3874 * allocated memory for the UUID list.
3875 */
3876 hci_discovery_filter_clear(hdev);
3877
3873 hdev->discovery.type = cp->type; 3878 hdev->discovery.type = cp->type;
3874 hdev->discovery.rssi = HCI_RSSI_INVALID;
3875 hdev->discovery.uuid_count = 0;
3876 3879
3877 hci_req_init(&req, hdev); 3880 hci_req_init(&req, hdev);
3878 3881
@@ -3957,6 +3960,11 @@ static int start_service_discovery(struct sock *sk, struct hci_dev *hdev,
3957 goto failed; 3960 goto failed;
3958 } 3961 }
3959 3962
3963 /* Clear the discovery filter first to free any previously
3964 * allocated memory for the UUID list.
3965 */
3966 hci_discovery_filter_clear(hdev);
3967
3960 hdev->discovery.type = cp->type; 3968 hdev->discovery.type = cp->type;
3961 hdev->discovery.rssi = cp->rssi; 3969 hdev->discovery.rssi = cp->rssi;
3962 hdev->discovery.uuid_count = uuid_count; 3970 hdev->discovery.uuid_count = uuid_count;