android_system_core/libsuspend
Kyle Russell a26b4caf4c autosuspend_inited flag set even if initialization fails
Prevents possible SIGSEGV on second autosuspend_enable attempt when
first intialization attempt fails.  autosuspend_inited should only
be set once autosuspend_ops has been assigned.

Consider the first call to autosuspend_enable().
autosuspend_init() sets its inited flag to true, and attempts to
set autosuspend_ops.  If all the other autosuspend_*_init() attempts
fail, autosuspend_init() returns -1, which autosuspend_enable()
will return as a failure.  A second call to autosuspend_enable()
will check autosuspend_init() and see that autosuspend has already
been initialized.  It will attempt to access autosuspend_ops, which
were not set in the first initialization attempt, causing a SIGSEGV.

Change-Id: Ib2d3ee62fee4c3b6d0323e5b7f3709a23c6b923f
2012-11-20 09:12:39 -05:00
..
include/suspend libsuspend: create new library to handle triggering suspend 2012-05-07 15:33:34 -07:00
Android.mk libsuspend: create new library to handle triggering suspend 2012-05-07 15:33:34 -07:00
autosuspend.c autosuspend_inited flag set even if initialization fails 2012-11-20 09:12:39 -05:00
autosuspend_autosleep.c libsuspend: force autosleep off during init 2012-09-21 18:39:17 -07:00
autosuspend_earlysuspend.c libsuspend: wait for earlysuspend transition to finish 2012-06-14 15:13:10 -07:00
autosuspend_ops.h libsuspend: create new library to handle triggering suspend 2012-05-07 15:33:34 -07:00
autosuspend_wakeup_count.c Fix unused param warning 2012-08-02 10:40:12 -04:00