From 022bbd14197558248aa138af1d6d433cbe3a7a84 Mon Sep 17 00:00:00 2001 From: Vikram Panduranga Date: Thu, 3 Oct 2019 16:27:57 -0700 Subject: [PATCH] hal: call ACDB deinit when init fails When ACDB initialization fails the deallocation should be called in order to free up any resources created during init. Change-Id: I6220ea241361f1bb46b83c9b30087af8d663d6ac --- hal/msm8916/platform.c | 2 ++ hal/msm8974/platform.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c index 73369eab..6c6d0de5 100644 --- a/hal/msm8916/platform.c +++ b/hal/msm8916/platform.c @@ -2533,6 +2533,8 @@ void *platform_init(struct audio_device *adev) } else { my_data->is_acdb_initialized = false; ALOGD("ACDB initialization failed"); + if (my_data->acdb_deallocate) + my_data->acdb_deallocate(); } } audio_extn_pm_vote(); diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c index cc75c9e1..264c6f64 100644 --- a/hal/msm8974/platform.c +++ b/hal/msm8974/platform.c @@ -3408,6 +3408,8 @@ void *platform_init(struct audio_device *adev) } else { my_data->is_acdb_initialized = false; ALOGD("ACDB initialization failed"); + if (my_data->acdb_deallocate) + my_data->acdb_deallocate(); } } /* init keep-alive for compress passthru */