Merge "agm: use list_for_each_safe instead of list_for_each" into audio-platform-arintf.lnx.1.0.c10
diff --git a/service/src/session_obj.c b/service/src/session_obj.c
index 2ab9f13..f3295b0 100644
--- a/service/src/session_obj.c
+++ b/service/src/session_obj.c
@@ -1254,6 +1254,7 @@
struct aif *aif_obj = NULL;
enum agm_session_mode sess_mode = sess_obj->stream_config.sess_mode;
struct listnode *node = NULL;
+ struct listnode *next = NULL;
AGM_LOGD("enter");
if (sess_obj->state == SESSION_CLOSED) {
@@ -1279,7 +1280,7 @@
sess_obj->loopback_state = false;
if (sess_mode != AGM_SESSION_NON_TUNNEL && sess_mode != AGM_SESSION_NO_CONFIG) {
- list_for_each(node, &sess_obj->aif_pool) {
+ list_for_each_safe(node, next, &sess_obj->aif_pool) {
aif_obj = node_to_item(node, struct aif, node);
if (!aif_obj) {
AGM_LOGE("Error:%d could not find aif node\n", ret);