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

Commit eb9255f5 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "primary-hal: Fix stability issues"

parents 20a0964d 4339e695
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 * Copyright (C) 2013 The Android Open Source Project
 *
 * Changes from Qualcomm Innovation Center are provided under the following license:
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
 * SPDX-License-Identifier: BSD-3-Clause-Clear
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -248,14 +248,14 @@ cleanup:
            free(key_info);
        }

        if (my_data->acdb_init_data.snd_card_name)
            free(my_data->acdb_init_data.snd_card_name);

        if (result < 0) {

            if (snd_card_name)
                free((void *)snd_card_name);

            if (my_data->acdb_init_data.snd_card_name)
                free(my_data->acdb_init_data.snd_card_name);

            if (my_data)
                platform_info_deinit();
        }
+5 −5
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the
@@ -1370,8 +1370,8 @@ static void* spkr_calibration_thread()
                        }
                       thermal_fd = open(wsa_path, O_RDONLY);
                       if (thermal_fd > 0) {
                           if ((ret = read(thermal_fd, buf, sizeof(buf))) >= 0) {
                               buf[ret-1] = '\0';
                           if ((ret = read(thermal_fd, buf, sizeof(buf)-1)) >= 0) {
                               buf[ret] = '\0';
                               t0_spk_1 = atoi(buf);
                           }
                           else
@@ -1406,8 +1406,8 @@ static void* spkr_calibration_thread()
                        }
                        thermal_fd = open(wsa_path, O_RDONLY);
                        if (thermal_fd > 0) {
                           if ((ret = read(thermal_fd, buf, sizeof(buf))) >= 0) {
                               buf[ret-1] = '\0';
                           if ((ret = read(thermal_fd, buf, sizeof(buf)-1)) >= 0) {
                               buf[ret] = '\0';
                               t0_spk_2 = atoi(buf);
                           }
                           else
+13 −3
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@
 * limitations under the License.
 *
 * Changes from Qualcomm Innovation Center are provided under the following license:
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
 * SPDX-License-Identifier: BSD-3-Clause-Clear
 *
 */
@@ -10817,8 +10817,13 @@ int adev_create_audio_patch(struct audio_hw_device *dev,
        s_info = hashmapGet(adev->io_streams_map, (void *) (intptr_t) io_handle);
        if (s_info == NULL) {
            ALOGE("%s: Failed to obtain stream info", __func__);
            if (new_patch)
            if (new_patch) {

                if(p_info->patch)
                    free(p_info->patch);

                free(p_info);
            }
            pthread_mutex_unlock(&adev->lock);
            ret = -EINVAL;
            goto done;
@@ -10839,8 +10844,13 @@ int adev_create_audio_patch(struct audio_hw_device *dev,
        if (ret < 0) {
            pthread_mutex_lock(&adev->lock);
            s_info->patch_handle = AUDIO_PATCH_HANDLE_NONE;
            if (new_patch)
            if (new_patch) {

                if(p_info->patch)
                    free(p_info->patch);

                free(p_info);
            }
            pthread_mutex_unlock(&adev->lock);
            ALOGE("%s: Stream routing failed for io_handle %d", __func__, io_handle);
            goto done;