sthal: check audio extn init result in stdev init
STHAL init may be successful even though audio extn
init fails in pal/agm side, this may cause crash
when ST framework try to get st properties.
Check audio extn init result to avoid stdev created
with pal/agm initialization failure.
Change-Id: Iac1deca81339b447a0947430ada762c8e5306425
diff --git a/SoundTriggerDevice.cpp b/SoundTriggerDevice.cpp
index cd9d616..567fd34 100644
--- a/SoundTriggerDevice.cpp
+++ b/SoundTriggerDevice.cpp
@@ -585,7 +585,11 @@
ALOGW("%s: error, failed to get symbol for initAudioExtn",
__func__);
} else {
- initAudioExtn();
+ status = initAudioExtn();
+ if (status) {
+ ALOGE("%s: error, failed to init audio extn", __func__);
+ goto error;
+ }
}
return status;
diff --git a/SoundTriggerPropIntf.h b/SoundTriggerPropIntf.h
index a2cb7a0..8e41e12 100644
--- a/SoundTriggerPropIntf.h
+++ b/SoundTriggerPropIntf.h
@@ -171,5 +171,5 @@
typedef void (*audio_hw_close_snd_mixer_t)(struct mixer *mixer);
/* AHAL extn util function which is called by STHAL */
-typedef void (*audio_extn_hidl_init)();
+typedef int (*audio_extn_hidl_init)();
#endif /* SOUND_TRIGGER_PROP_INTF_H */