hal: Fix VTS errors
Deinit speaker protection thread(Cirrus)
before deinit of platform to avoid usage of
platform NULL pointer for further underlying
function calls.
Add a check to handle NULL pointer if VTS testcases
does not open a usecase.
Change-Id: I300a9b47e80e0d8349a15ed17533e62b2e7bf214
diff --git a/hal/audio_extn/maxxaudio.c b/hal/audio_extn/maxxaudio.c
index b6249ef..3d51636 100644
--- a/hal/audio_extn/maxxaudio.c
+++ b/hal/audio_extn/maxxaudio.c
@@ -284,7 +284,7 @@
list_for_each(node, &adev->usecase_list) {
usecase = node_to_item(node, struct audio_usecase, list);
- if (valid_usecase(usecase)) {
+ if (usecase->stream.out && valid_usecase(usecase)) {
ma_cal.common.app_type = usecase->stream.out->app_type_cfg.app_type;
ma_cal.common.device = usecase->stream.out->devices;
ALOGV("%s: send usecase(%d) app_type(%d) device(%d)",