Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277689
b: refs/heads/master
c: 33ca954
h: refs/heads/master
i:
  277687: 2970326
v: v3
  • Loading branch information
David Herrmann authored and Gustavo F. Padovan committed Oct 14, 2011
1 parent 4c699ce commit c7f5f24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce242970f0934869483221c410d09c00bc8967e7
refs/heads/master: 33ca954daf1ac03c86237b73235d8b0856d84981
18 changes: 12 additions & 6 deletions trunk/net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ int hci_add_adv_entry(struct hci_dev *hdev,
int hci_register_dev(struct hci_dev *hdev)
{
struct list_head *head = &hci_dev_list, *p;
int i, id = 0;
int i, id = 0, error;

BT_DBG("%p name %s bus %d owner %p", hdev, hdev->name,
hdev->bus, hdev->owner);
Expand Down Expand Up @@ -1503,10 +1503,14 @@ int hci_register_dev(struct hci_dev *hdev)
write_unlock_bh(&hci_dev_list_lock);

hdev->workqueue = create_singlethread_workqueue(hdev->name);
if (!hdev->workqueue)
goto nomem;
if (!hdev->workqueue) {
error = -ENOMEM;
goto err;
}

hci_add_sysfs(hdev);
error = hci_add_sysfs(hdev);
if (error < 0)
goto err_wqueue;

hdev->rfkill = rfkill_alloc(hdev->name, &hdev->dev,
RFKILL_TYPE_BLUETOOTH, &hci_rfkill_ops, hdev);
Expand All @@ -1525,12 +1529,14 @@ int hci_register_dev(struct hci_dev *hdev)

return id;

nomem:
err_wqueue:
destroy_workqueue(hdev->workqueue);
err:
write_lock_bh(&hci_dev_list_lock);
list_del(&hdev->list);
write_unlock_bh(&hci_dev_list_lock);

return -ENOMEM;
return error;
}
EXPORT_SYMBOL(hci_register_dev);

Expand Down

0 comments on commit c7f5f24

Please sign in to comment.