Skip to content

Commit 6c9e478

Browse files
MarkWangChinesekartben
authored andcommitted
Bluetooth: Classic: Fix assert when aborting initiating SCO connection
return an error instead of assert Signed-off-by: Mark Wang <[email protected]>
1 parent 73d19ac commit 6c9e478

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

subsys/bluetooth/host/conn.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,6 +1883,9 @@ int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason)
18831883
#if defined(CONFIG_BT_CLASSIC)
18841884
else if (conn->type == BT_CONN_TYPE_BR) {
18851885
return bt_hci_connect_br_cancel(conn);
1886+
} else if (conn->type == BT_CONN_TYPE_SCO) {
1887+
/* There is no HCI cmd to cancel SCO connecting from spec */
1888+
return -EPROTONOSUPPORT;
18861889
}
18871890
#endif /* CONFIG_BT_CLASSIC */
18881891
else {

0 commit comments

Comments
 (0)