提交 c89ad737 编写于 作者: G Gustavo F. Padovan

Bluetooth: Fix not returning proper error in SCO

Return 0 in that situation could lead to errors in the caller.
Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
上级 7379efea
...@@ -882,7 +882,7 @@ static int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) ...@@ -882,7 +882,7 @@ static int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type)
int lm = 0; int lm = 0;
if (type != SCO_LINK && type != ESCO_LINK) if (type != SCO_LINK && type != ESCO_LINK)
return 0; return -EINVAL;
BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr)); BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr));
...@@ -908,7 +908,7 @@ static int sco_connect_cfm(struct hci_conn *hcon, __u8 status) ...@@ -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); BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status);
if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK)
return 0; return -EINVAL;
if (!status) { if (!status) {
struct sco_conn *conn; struct sco_conn *conn;
...@@ -927,7 +927,7 @@ static int sco_disconn_cfm(struct hci_conn *hcon, __u8 reason) ...@@ -927,7 +927,7 @@ static int sco_disconn_cfm(struct hci_conn *hcon, __u8 reason)
BT_DBG("hcon %p reason %d", hcon, reason); BT_DBG("hcon %p reason %d", hcon, reason);
if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK)
return 0; return -EINVAL;
sco_conn_del(hcon, bt_err(reason)); sco_conn_del(hcon, bt_err(reason));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册