hal: fix null pointer references and data initialization errors

  - add null pointer check and initialize uninitialized variables

CRs-Fixed: 2075786
Change-Id: I12f53d12c2e7c36155b1abd10f5a39fb0318da28
1 file changed