Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06309754 authored by Jeff Brown's avatar Jeff Brown
Browse files

Ensure outValue is set, even when an error occurs.

Change-Id: If883f60cde28792bd0e108597ced49d69d13136e
parent 8bcbbefa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
}