Return error code directly in allocateHelper() am: aa8b7ac832 am: 504194d515 am: 5ef00bb36a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/14806071

Change-Id: I9efebc36f022c75af470de2e9fa90e2bb38b5916