diff --git a/profiles/input/device.c b/profiles/input/device.c
index a494ea2..d66c41a 100644
--- a/profiles/input/device.c
+++ b/profiles/input/device.c
*/
if (device_is_temporary(idev->device) ||
btd_device_is_connected(idev->device))
- return FALSE;
+ goto bail;
/* Only attempt an auto-reconnect for at most 3 minutes (6 * 30s). */
if (idev->reconnect_attempt >= 6)
- return FALSE;
+ goto bail;
/* Check if the profile is already connected. */
if (idev->ctrl_io)
- return FALSE;
+ goto bail;
if (is_connected(idev))
- return FALSE;
+ goto bail;
idev->reconnect_attempt++;
dev_connect(idev);
return TRUE;
+
+bail:
+ idev->reconnect_timer = 0;
+ return FALSE;
}
static const char * const _reconnect_mode_str[] = {