diff --git a/net/bluetooth/msft.c b/net/bluetooth/msft.c index 6f4b7c38a247..2559c5b1bef0 100644 --- a/net/bluetooth/msft.c +++ b/net/bluetooth/msft.c @@ -683,6 +683,8 @@ void msft_do_close(struct hci_dev *hdev) bt_dev_dbg(hdev, "Cleanup of MSFT extension"); + hci_dev_lock(hdev); + /* The controller will silently remove all monitors on power off. * Therefore, remove handle_data mapping and reset monitor state. */ @@ -697,6 +699,8 @@ void msft_do_close(struct hci_dev *hdev) kfree(handle_data); } + hci_dev_unlock(hdev); + mutex_lock(&msft->filter_lock); list_for_each_entry_safe(address_filter, n, &msft->address_filters, list) {