diff options
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r-- | net/bluetooth/hci_core.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 596660d37c5e..f73907aad79f 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -1799,6 +1799,15 @@ int hci_register_dev(struct hci_dev *hdev) | |||
1799 | goto err; | 1799 | goto err; |
1800 | } | 1800 | } |
1801 | 1801 | ||
1802 | hdev->req_workqueue = alloc_workqueue(hdev->name, | ||
1803 | WQ_HIGHPRI | WQ_UNBOUND | | ||
1804 | WQ_MEM_RECLAIM, 1); | ||
1805 | if (!hdev->req_workqueue) { | ||
1806 | destroy_workqueue(hdev->workqueue); | ||
1807 | error = -ENOMEM; | ||
1808 | goto err; | ||
1809 | } | ||
1810 | |||
1802 | error = hci_add_sysfs(hdev); | 1811 | error = hci_add_sysfs(hdev); |
1803 | if (error < 0) | 1812 | if (error < 0) |
1804 | goto err_wqueue; | 1813 | goto err_wqueue; |
@@ -1827,6 +1836,7 @@ int hci_register_dev(struct hci_dev *hdev) | |||
1827 | 1836 | ||
1828 | err_wqueue: | 1837 | err_wqueue: |
1829 | destroy_workqueue(hdev->workqueue); | 1838 | destroy_workqueue(hdev->workqueue); |
1839 | destroy_workqueue(hdev->req_workqueue); | ||
1830 | err: | 1840 | err: |
1831 | ida_simple_remove(&hci_index_ida, hdev->id); | 1841 | ida_simple_remove(&hci_index_ida, hdev->id); |
1832 | write_lock(&hci_dev_list_lock); | 1842 | write_lock(&hci_dev_list_lock); |
@@ -1880,6 +1890,7 @@ void hci_unregister_dev(struct hci_dev *hdev) | |||
1880 | hci_del_sysfs(hdev); | 1890 | hci_del_sysfs(hdev); |
1881 | 1891 | ||
1882 | destroy_workqueue(hdev->workqueue); | 1892 | destroy_workqueue(hdev->workqueue); |
1893 | destroy_workqueue(hdev->req_workqueue); | ||
1883 | 1894 | ||
1884 | hci_dev_lock(hdev); | 1895 | hci_dev_lock(hdev); |
1885 | hci_blacklist_clear(hdev); | 1896 | hci_blacklist_clear(hdev); |