diff options
| author | 2011-08-11 18:26:11 -0700 | |
|---|---|---|
| committer | 2011-08-11 18:26:11 -0700 | |
| commit | 61bb11cfa03abc345f27ec14f63929b6f600edff (patch) | |
| tree | 966e0e0870317c9519d148ec73f634fe80d1f098 | |
| parent | c88ba95921444946443794cbaca5911f1a924720 (diff) | |
| parent | 063097545e6a273952463803d1a2fab2cb590d4e (diff) | |
Merge "Ensure outValue is set, even when an error occurs."
| -rw-r--r-- | services/input/EventHub.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp index 960e4143e659..1d7cc19c02b8 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; } |