summaryrefslogtreecommitdiffstats
path: root/post_proc
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2015-09-08 17:31:36 -0700
committerAndy Hung <hunga@google.com>2015-09-16 00:44:53 +0000
commit7106b08ee43b84978e370b9c25e89f1ed7bfbf0d (patch)
tree86978083165cd70e604b1adf5a42dd527e513845 /post_proc
parent4cb8298a322ef5be6f8db002e50c764fdecc2c55 (diff)
downloadhardware_qcom_audio-7106b08ee43b84978e370b9c25e89f1ed7bfbf0d.tar.gz
hardware_qcom_audio-7106b08ee43b84978e370b9c25e89f1ed7bfbf0d.tar.bz2
hardware_qcom_audio-7106b08ee43b84978e370b9c25e89f1ed7bfbf0d.zip
DO NOT MERGE - volume_listener: fix release
use safe iteration of list when removing node. Bug: 23731264 Change-Id: I6d0c51638b6a3de684cf595833dc4d0fc7e8c8b5 (cherry picked from commit 591ef60fb95d863cb8f3a3923d59bc36c8cd4b8c)
Diffstat (limited to 'post_proc')
-rw-r--r--post_proc/volume_listener.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/post_proc/volume_listener.c b/post_proc/volume_listener.c
index e0193dde..cf15f1ca 100644
--- a/post_proc/volume_listener.c
+++ b/post_proc/volume_listener.c
@@ -664,7 +664,7 @@ static int vol_prc_lib_create(const effect_uuid_t *uuid,
static int vol_prc_lib_release(effect_handle_t handle)
{
- struct listnode *node = NULL;
+ struct listnode *node, *temp_node_next;
vol_listener_context_t *context = NULL;
vol_listener_context_t *recv_contex = (vol_listener_context_t *)handle;
int status = -1;
@@ -674,7 +674,7 @@ static int vol_prc_lib_release(effect_handle_t handle)
pthread_mutex_lock(&vol_listner_init_lock);
// check if the handle/context provided is valid
- list_for_each(node, &vol_effect_list) {
+ list_for_each_safe(node, temp_node_next, &vol_effect_list) {
context = node_to_item(node, struct vol_listener_context_s, effect_list_node);
if ((memcmp(&(context->desc->uuid), &(recv_contex->desc->uuid), sizeof(effect_uuid_t)) == 0)
&& (context->session_id == recv_contex->session_id)