st-hal: Add error handling check
Add error handling check for conf_levels.
Change-Id: Iaa4f786a4e0be71870b87a49787d3ec4c9750567
diff --git a/st_session.c b/st_session.c
index 1a9b630..10aef77 100644
--- a/st_session.c
+++ b/st_session.c
@@ -2653,6 +2653,11 @@
* during only one remaining client model as there won't be a
* merged model yet.
*/
+ if (!conf_levels) {
+ ALOGE("%s: ERROR. conf levels alloc failed", __func__);
+ status = -ENOMEM;
+ return status;
+ }
memcpy(stc_ses->sm_info.cf_levels, conf_levels,
stc_ses->sm_info.cf_levels_size);