hal : Fix input validation errors

 fix miscellaneous errors and add null check
 to avoid following errors
 673141, 673142, 673153, 673154, 673155
 1944609, 1944610

Change-Id: Ica531084375af8404472566a0a664fd0b7f41dd7
2 files changed