|
@@ -8487,6 +8487,7 @@ static int q6asm_memory_map_regions(struct audio_client *ac, int dir,
|
|
|
if (mmap_region_cmd == NULL) {
|
|
|
rc = -EINVAL;
|
|
|
kfree(buffer_node);
|
|
|
+ buffer_node = NULL;
|
|
|
return rc;
|
|
|
}
|
|
|
mmap_regions = (struct avs_cmd_shared_mem_map_regions *)
|
|
@@ -8523,6 +8524,7 @@ static int q6asm_memory_map_regions(struct audio_client *ac, int dir,
|
|
|
mmap_regions->hdr.opcode, rc);
|
|
|
rc = -EINVAL;
|
|
|
kfree(buffer_node);
|
|
|
+ buffer_node = NULL;
|
|
|
goto fail_cmd;
|
|
|
}
|
|
|
|
|
@@ -8534,6 +8536,7 @@ static int q6asm_memory_map_regions(struct audio_client *ac, int dir,
|
|
|
pr_err("%s: timeout. waited for memory_map\n", __func__);
|
|
|
rc = -ETIMEDOUT;
|
|
|
kfree(buffer_node);
|
|
|
+ buffer_node = NULL;
|
|
|
goto fail_cmd;
|
|
|
}
|
|
|
if (atomic_read(&ac->mem_state) > 0) {
|
|
@@ -8543,6 +8546,7 @@ static int q6asm_memory_map_regions(struct audio_client *ac, int dir,
|
|
|
rc = adsp_err_get_lnx_err_code(
|
|
|
atomic_read(&ac->mem_state));
|
|
|
kfree(buffer_node);
|
|
|
+ buffer_node = NULL;
|
|
|
goto fail_cmd;
|
|
|
}
|
|
|
mutex_lock(&ac->cmd_lock);
|
|
@@ -8562,6 +8566,7 @@ static int q6asm_memory_map_regions(struct audio_client *ac, int dir,
|
|
|
rc = 0;
|
|
|
fail_cmd:
|
|
|
kfree(mmap_region_cmd);
|
|
|
+ mmap_region_cmd = NULL;
|
|
|
return rc;
|
|
|
}
|
|
|
EXPORT_SYMBOL(q6asm_memory_map_regions);
|
|
@@ -8657,6 +8662,7 @@ fail_cmd:
|
|
|
if (buf_node->buf_phys_addr == buf_add) {
|
|
|
list_del(&buf_node->list);
|
|
|
kfree(buf_node);
|
|
|
+ buf_node = NULL;
|
|
|
break;
|
|
|
}
|
|
|
}
|