hal: Fix input validation error

 -dereference object post null check to fix below error
  6700584

Change-Id: I240b0fbbcfee10136e07679c66000ff289d51938
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 8daa715..fc706f8 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -4310,8 +4310,8 @@
             struct audio_usecase *uc;
             uc = node_to_item(node, struct audio_usecase, list);
             struct stream_out *out = (struct stream_out*) uc->stream.out;
-            unsigned int out_channels = audio_channel_count_from_out_mask(out->channel_mask);
             if (uc->type == PCM_PLAYBACK && out && usecase != uc) {
+                unsigned int out_channels = audio_channel_count_from_out_mask(out->channel_mask);
 
                 ALOGD("%s:napb: (%d) - (%s)id (%d) sr %d bw "
                       "(%d) ch (%d) device %s", __func__, i++, use_case_table[uc->id],