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

Commit 7b762e7c authored by Mingming Yin's avatar Mingming Yin
Browse files

hal: fix klockwork failures in audio hal

- Fix klockwork failures in audio_hw.c and platform.c

Change-Id: I4a3b7e11c9050c3b1f0fe4e3d564b879065b3203
parent e0b22e0e
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -1956,7 +1956,7 @@ static char* out_get_parameters(const struct audio_stream *stream, const char *k
    } else {
        voice_extn_out_get_parameters(out, query, reply);
        str = str_parms_to_str(reply);
        if (!strncmp(str, "", sizeof(""))) {
        if (str && !strncmp(str, "", sizeof(""))) {
            free(str);
            str = strdup(keys);
        }
@@ -3062,14 +3062,13 @@ static void adev_close_output_stream(struct audio_hw_device *dev __unused,

static void close_compress_sessions(struct audio_device *adev)
{
    struct stream_out *out = NULL;
    struct listnode *node = NULL;
    struct listnode *tmp = NULL;
    struct audio_usecase *usecase = NULL;
    struct stream_out *out;
    struct listnode *node;
    struct audio_usecase *usecase;
    pthread_mutex_lock(&adev->lock);
    list_for_each_safe(node, tmp, &adev->usecase_list) {
    list_for_each(node, &adev->usecase_list) {
        usecase = node_to_item(node, struct audio_usecase, list);
        if (is_offload_usecase(usecase->id)) {
        if (usecase && is_offload_usecase(usecase->id)) {
            if (usecase && usecase->stream.out) {
                ALOGI(" %s closing compress session %d on OFFLINE state", __func__, usecase->id);
                out = usecase->stream.out;

hal/msm8974/platform.c

100755 → 100644
+8 −1
Original line number Diff line number Diff line
@@ -2489,6 +2489,12 @@ int platform_set_parameters(void *platform, struct str_parms *parms)
    int ret = 0, err;
    char *kv_pairs = str_parms_to_str(parms);

    if(kv_pairs == NULL) {
        ret = -ENOMEM;
        ALOGE("[%s] key-value pair is NULL",__func__);
        goto done;
    }

    ALOGV_IF(kv_pairs != NULL, "%s: enter: %s", __func__, kv_pairs);

    len = strlen(kv_pairs);
@@ -2568,6 +2574,7 @@ int platform_set_parameters(void *platform, struct str_parms *parms)

done:
    ALOGV("%s: exit with code(%d)", __func__, ret);
    if(kv_pairs != NULL)
        free(kv_pairs);
    if(value != NULL)
        free(value);