summaryrefslogtreecommitdiff
path: root/trusty/coverage/coverage_test.cpp
diff options
context:
space:
mode:
authorKyle Russell <bkylerussell@gmail.com>2012-11-19 16:29:58 -0500
committerKyle Russell <bkylerussell@gmail.com>2012-11-20 09:12:39 -0500
commita26b4caf4cf5241e5c2145f53ec7170200ab4bb9 (patch)
treee9d17cc3f45fa420eb14c014a05e42ce9e228eea /trusty/coverage/coverage_test.cpp
parent3ddc0059bb897c4d7d2e0c6d9812d590388480d1 (diff)
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
Diffstat (limited to 'trusty/coverage/coverage_test.cpp')
0 files changed, 0 insertions, 0 deletions