Ensure outValue is set, even when an error occurs.
Change-Id: If883f60cde28792bd0e108597ced49d69d13136e
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 @@
}
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 @@
return OK;
}
}
- *outValue = 0;
return -1;
}