Commit 5396c9356efec1d3d818b786f69e081aaad4b98b
Committed by
David S. Miller
1 parent
30a50cc566
Exists in
master
and in
7 other branches
[BLUETOOTH]: Fix bugs in previous conn add/del workqueue changes.
Jens Axboe noticed that we were queueing &conn->work on both btaddconn and keventd_wq. Signed-off-by: Dave Young <hidave.darkstar@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 6 additions and 2 deletions Side-by-side Diff
net/bluetooth/hci_sysfs.c
... | ... | @@ -282,6 +282,7 @@ |
282 | 282 | int i; |
283 | 283 | |
284 | 284 | flush_workqueue(btdelconn); |
285 | + | |
285 | 286 | if (device_add(&conn->dev) < 0) { |
286 | 287 | BT_ERR("Failed to register connection device"); |
287 | 288 | return; |
... | ... | @@ -317,7 +318,6 @@ |
317 | 318 | INIT_WORK(&conn->work, add_conn); |
318 | 319 | |
319 | 320 | queue_work(btaddconn, &conn->work); |
320 | - schedule_work(&conn->work); | |
321 | 321 | } |
322 | 322 | |
323 | 323 | static int __match_tty(struct device *dev, void *data) |
... | ... | @@ -354,7 +354,6 @@ |
354 | 354 | INIT_WORK(&conn->work, del_conn); |
355 | 355 | |
356 | 356 | queue_work(btdelconn, &conn->work); |
357 | - schedule_work(&conn->work); | |
358 | 357 | } |
359 | 358 | |
360 | 359 | int hci_register_sysfs(struct hci_dev *hdev) |
... | ... | @@ -408,6 +407,7 @@ |
408 | 407 | err = -ENOMEM; |
409 | 408 | goto out; |
410 | 409 | } |
410 | + | |
411 | 411 | btdelconn = create_singlethread_workqueue("btdelconn"); |
412 | 412 | if (!btdelconn) { |
413 | 413 | err = -ENOMEM; |
414 | 414 | |
415 | 415 | |
416 | 416 | |
... | ... | @@ -447,9 +447,13 @@ |
447 | 447 | void bt_sysfs_cleanup(void) |
448 | 448 | { |
449 | 449 | destroy_workqueue(btaddconn); |
450 | + | |
450 | 451 | destroy_workqueue(btdelconn); |
452 | + | |
451 | 453 | class_destroy(bt_class); |
454 | + | |
452 | 455 | bus_unregister(&bt_bus); |
456 | + | |
453 | 457 | platform_device_unregister(bt_platform); |
454 | 458 | } |