diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index bf8b67094f3..20f7f4274aa 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -1631,6 +1631,7 @@ int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason) switch (conn->state) { case BT_CONN_CONNECT_SCAN: + conn->err = reason; bt_conn_set_state(conn, BT_CONN_DISCONNECTED); bt_le_scan_update(false); return 0;