hal: Add NULL checks and fix data initialization errors.

Add proper checks to fix NULL pointer dereference issues and fix data initialization errors.

CRs-Fixed: 2125325
Change-Id: I7ecf4381c106f10bd601299654fca5de583010ad
1 file changed