diff --git a/android/hidhost.c b/android/hidhost.c
index 846dd57..fdbe885 100644
--- a/android/hidhost.c
+++ b/android/hidhost.c
ba2str(&dev->dst, addr);
DBG("connecting to %s", addr);
+ devices = g_slist_append(devices, dev);
+
if (bt_is_device_le(&dst)) {
if (!hog_connect(dev)) {
status = HAL_STATUS_FAILED;
+ hid_device_remove(dev);
goto failed;
}
goto done;
}
done:
- devices = g_slist_append(devices, dev);
-
if (dev->state == HAL_HIDHOST_STATE_DISCONNECTED)
bt_hid_notify_state(dev, HAL_HIDHOST_STATE_CONNECTING);