hal:  KW fixes for NULL checks and invalid index

Change-Id: I800c9cdee7af5c63c2584627f35a793b33387dc9
1 file changed