summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-08-11 17:10:06 -0700
committerJeff Brown <jeffbrown@google.com>2011-08-11 17:10:06 -0700
commit063097545e6a273952463803d1a2fab2cb590d4e (patch)
tree0155ff6d5cfaf58cf038ad53a24693c3cd90ad00 /services
parent8bcbbefa3b4e149099b2057547543ea95a7be400 (diff)
downloadframeworks_base-063097545e6a273952463803d1a2fab2cb590d4e.zip
frameworks_base-063097545e6a273952463803d1a2fab2cb590d4e.tar.gz
frameworks_base-063097545e6a273952463803d1a2fab2cb590d4e.tar.bz2
Ensure outValue is set, even when an error occurs.
Change-Id: If883f60cde28792bd0e108597ced49d69d13136e
Diffstat (limited to 'services')
-rw-r--r--services/input/EventHub.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
index 960e414..1d7cc19 100644
--- a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -312,6 +312,8 @@ int32_t EventHub::getSwitchState(int32_t deviceId, int32_t sw) const {
}
status_t EventHub::getAbsoluteAxisValue(int32_t deviceId, int32_t axis, int32_t* outValue) const {
+ *outValue = 0;
+
if (axis >= 0 && axis <= ABS_MAX) {
AutoMutex _l(mLock);
@@ -328,7 +330,6 @@ status_t EventHub::getAbsoluteAxisValue(int32_t deviceId, int32_t axis, int32_t*
return OK;
}
}
- *outValue = 0;
return -1;
}