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
This commit is contained in:
Vikram Panduranga 2019-10-03 16:27:57 -07:00 committed by Gerrit - the friendly Code Review server
parent 15fa15d8ac
commit 022bbd1419
2 changed files with 4 additions and 0 deletions

View File

@ -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();

View File

@ -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 */