Merge "autosuspend_inited flag set even if initialization fails"
diff --git a/libsuspend/autosuspend.c b/libsuspend/autosuspend.c
index 7d1d973..eb1f66e 100644
--- a/libsuspend/autosuspend.c
+++ b/libsuspend/autosuspend.c
@@ -33,8 +33,6 @@
         return 0;
     }
 
-    autosuspend_inited = true;
-
     autosuspend_ops = autosuspend_earlysuspend_init();
     if (autosuspend_ops) {
         goto out;
@@ -56,6 +54,8 @@
     }
 
 out:
+    autosuspend_inited = true;
+
     ALOGV("autosuspend initialized\n");
     return 0;
 }