Improve the error-handling code paths to prevent accesses to
uninitialized variables. This is done by either picking a sane
default for the variable or skipping accesses altogether after
an unsuccessful attempt to initialize.
CRs-Fixed: 2748220
Change-Id: Ibe383e56ec4e3f45f76f619c7d6b62c3d7dfcadb
Signed-off-by: Fernando Pacheco <fpacheco@codeaurora.org>