aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/sco.c
diff options
context:
space:
mode:
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 c9348ddda877..42fdffd1d76c 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -190,20 +190,21 @@ static int sco_connect(struct sock *sk)
190 190
191 hci_dev_lock_bh(hdev); 191 hci_dev_lock_bh(hdev);
192 192
193 err = -ENOMEM;
194
195 if (lmp_esco_capable(hdev) && !disable_esco) 193 if (lmp_esco_capable(hdev) && !disable_esco)
196 type = ESCO_LINK; 194 type = ESCO_LINK;
197 else 195 else
198 type = SCO_LINK; 196 type = SCO_LINK;
199 197
200 hcon = hci_connect(hdev, type, dst, BT_SECURITY_LOW, HCI_AT_NO_BONDING); 198 hcon = hci_connect(hdev, type, dst, BT_SECURITY_LOW, HCI_AT_NO_BONDING);
201 if (!hcon) 199 if (IS_ERR(hcon)) {
200 err = PTR_ERR(hcon);
202 goto done; 201 goto done;
202 }
203 203
204 conn = sco_conn_add(hcon, 0); 204 conn = sco_conn_add(hcon, 0);
205 if (!conn) { 205 if (!conn) {
206 hci_conn_put(hcon); 206 hci_conn_put(hcon);
207 err = -ENOMEM;
207 goto done; 208 goto done;
208 } 209 }
209 210