Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d90940c9 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: Fix adev_open error handling" into audio-hal.lnx.5.0

parents d8ab1d9f 2684ad75
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -7308,23 +7308,25 @@ static int adev_open(const hw_module_t *module, const char *name,
    /* Loads platform specific libraries dynamically */
    adev->platform = platform_init(adev);
    if (!adev->platform) {
        pthread_mutex_destroy(&adev->lock);
        free(adev->snd_dev_ref_cnt);
        free(adev);
        adev = NULL;
        ALOGE("%s: Failed to init platform data, aborting.", __func__);
        *device = NULL;
        pthread_mutex_unlock(&adev_init_lock);
        pthread_mutex_destroy(&adev->lock);
        return -EINVAL;
    }

    if (audio_extn_qaf_is_enabled()) {
        ret = audio_extn_qaf_init(adev);
        if (ret < 0) {
            pthread_mutex_destroy(&adev->lock);
            free(adev);
            adev = NULL;
            ALOGE("%s: Failed to init platform data, aborting.", __func__);
            *device = NULL;
            pthread_mutex_unlock(&adev_init_lock);
            pthread_mutex_destroy(&adev->lock);
            return ret;
        }