hal: Add NULL checks and fix data initialization errors.

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

Change-Id: I2fbcbc209728b0b3f4774e943518a0883cd7e2be
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 0f82a38..fcbe1d6 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2350,6 +2350,12 @@
     /* 1. Enable output device and stream routing controls */
     int ret = 0;
     struct audio_usecase *uc_info;
+
+    if (in == NULL) {
+        ALOGE("%s: stream_in ptr is NULL", __func__);
+        return -EINVAL;
+    }
+
     struct audio_device *adev = in->dev;
     struct pcm_config config = in->config;
     int usecase = platform_update_usecase_from_source(in->source,in->usecase);