Diff between 5202ff40cf649f68b7d2a81ac794091db224eef2 and bc1b1717bf93ccddfaed0a680fb17188eafaae1f

Changed Files

File Additions Deletions Status
profiles/input/device.c +8 -4 modified

Full Patch

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
@@ -1163,23 +1163,27 @@ static gboolean input_device_auto_reconnect(gpointer user_data)
 	 */
 	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[] = {