diff options
author | Andy Hung <hunga@google.com> | 2015-09-08 17:31:36 -0700 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-09-28 17:08:25 -0700 |
commit | 27a9bff3db294b0de9ec5fe2881c2ed9b49efc64 (patch) | |
tree | 86978083165cd70e604b1adf5a42dd527e513845 | |
parent | 9fb88063e241ad5fa1d62a48c90fa6fe0e250f4c (diff) | |
download | audio-marshmallow-release.tar.gz |
DO NOT MERGE - volume_listener: fix releaseandroid-cts-6.0_r9android-cts-6.0_r8android-cts-6.0_r7android-cts-6.0_r6android-cts-6.0_r5android-cts-6.0_r4android-cts-6.0_r32android-cts-6.0_r31android-cts-6.0_r30android-cts-6.0_r3android-cts-6.0_r29android-cts-6.0_r28android-cts-6.0_r27android-cts-6.0_r26android-cts-6.0_r25android-cts-6.0_r24android-cts-6.0_r23android-cts-6.0_r22android-cts-6.0_r21android-cts-6.0_r20android-cts-6.0_r2android-cts-6.0_r19android-cts-6.0_r18android-cts-6.0_r17android-cts-6.0_r16android-cts-6.0_r15android-cts-6.0_r14android-cts-6.0_r13android-cts-6.0_r12android-6.0.0_r7android-6.0.0_r6android-6.0.0_r5android-6.0.0_r4android-6.0.0_r3android-6.0.0_r2marshmallow-releasemarshmallow-cts-release
use safe iteration of list when removing node.
Bug: 23731264
Change-Id: I6d0c51638b6a3de684cf595833dc4d0fc7e8c8b5
(cherry picked from commit 591ef60fb95d863cb8f3a3923d59bc36c8cd4b8c)
-rw-r--r-- | post_proc/volume_listener.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/post_proc/volume_listener.c b/post_proc/volume_listener.c index e0193dd..cf15f1c 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) |