aboutsummaryrefslogtreecommitdiff
path: root/net/bluetooth/sco.c
diff options
context:
space:
mode:
authorVille Tervo <ville.tervo@nokia.com>2011-02-22 16:10:53 -0300
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-27 17:11:29 -0300
commit30e7627219f985cd17a1ac24e0163ebcfb1277bf (patch)
treef4c6688dff4b74d42327ca43b4660b9848c40b01 /net/bluetooth/sco.c
parentbdce7bafb786701004b2055e15d6ff4b3be678f3 (diff)
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>
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r--net/bluetooth/sco.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index c9348ddda87..42fdffd1d76 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -190,20 +190,21 @@ static int sco_connect(struct sock *sk)
hci_dev_lock_bh(hdev);
- err = -ENOMEM;
-
if (lmp_esco_capable(hdev) && !disable_esco)
type = ESCO_LINK;
else
type = SCO_LINK;
hcon = hci_connect(hdev, type, dst, BT_SECURITY_LOW, HCI_AT_NO_BONDING);
- if (!hcon)
+ if (IS_ERR(hcon)) {
+ err = PTR_ERR(hcon);
goto done;
+ }
conn = sco_conn_add(hcon, 0);
if (!conn) {
hci_conn_put(hcon);
+ err = -ENOMEM;
goto done;
}