Bluetooth: Use ERR_PTR as return error from hci_connect

Use ERR_PTR mechanism to return error from hci_connect.

Signed-off-by: Ville Tervo <ville.tervo@nokia.com>
Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
Ville Tervo
2011-02-22 16:10:53 -03:00
committed by Gustavo F. Padovan
parent bdce7bafb7
commit 30e7627219
4 changed files with 14 additions and 12 deletions

View File

@@ -431,10 +431,10 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
if (type == LE_LINK) {
le = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst);
if (le)
return NULL;
return ERR_PTR(-EBUSY);
le = hci_conn_add(hdev, LE_LINK, dst);
if (!le)
return NULL;
return ERR_PTR(-ENOMEM);
if (le->state == BT_OPEN)
hci_le_connect(le);