From 9205fe0a3a61ed0902d5f743edd0c6171e097608 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Fri, 11 Dec 2020 13:49:51 +0100 Subject: [PATCH] Bluetooth: host: Return error code if disconnect has invalid parameters Return the error code from the disconnect command to the application when an invalid disconnect reason has been provided. Signed-off-by: Joakim Andersson --- subsys/bluetooth/host/hci_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index ce39db4f1d4..a94b092262a 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1539,7 +1539,7 @@ int bt_hci_disconnect(uint16_t handle, uint8_t reason) disconn->handle = sys_cpu_to_le16(handle); disconn->reason = reason; - return bt_hci_cmd_send(BT_HCI_OP_DISCONNECT, buf); + return bt_hci_cmd_send_sync(BT_HCI_OP_DISCONNECT, buf, NULL); } static void hci_disconn_complete_prio(struct net_buf *buf)