Skip to content

Commit

Permalink
Bluetooth: Fix not returning proper error in SCO
Browse files Browse the repository at this point in the history
Return 0 in that situation could lead to errors in the caller.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
  • Loading branch information
Gustavo F. Padovan committed Nov 22, 2010
1 parent 7379efe commit c89ad73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/bluetooth/sco.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ static int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type)
int lm = 0;

if (type != SCO_LINK && type != ESCO_LINK)
return 0;
return -EINVAL;

BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr));

Expand All @@ -908,7 +908,7 @@ static int sco_connect_cfm(struct hci_conn *hcon, __u8 status)
BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status);

if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK)
return 0;
return -EINVAL;

if (!status) {
struct sco_conn *conn;
Expand All @@ -927,7 +927,7 @@ static int sco_disconn_cfm(struct hci_conn *hcon, __u8 reason)
BT_DBG("hcon %p reason %d", hcon, reason);

if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK)
return 0;
return -EINVAL;

sco_conn_del(hcon, bt_err(reason));

Expand Down

0 comments on commit c89ad73

Please sign in to comment.