summaryrefslogtreecommitdiffstats
path: root/hal
diff options
context:
space:
mode:
authorAalique Grahame <agrahame@codeaurora.org>2016-12-22 13:02:32 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-04 04:39:56 -0800
commit6379b8d8a087d6fdafc74920dce8b1016305cf6f (patch)
tree19e2e714b57686db12b13939b93cea3e9393ece4 /hal
parentbdee97c734bfe2cf5f2b2d6c599e93734feb442c (diff)
downloadhardware_qcom_audio-6379b8d8a087d6fdafc74920dce8b1016305cf6f.tar.gz
hardware_qcom_audio-6379b8d8a087d6fdafc74920dce8b1016305cf6f.tar.bz2
hardware_qcom_audio-6379b8d8a087d6fdafc74920dce8b1016305cf6f.zip
hal: go from head of usecase list after removing offload usecase during ssr
When SSR is happening and the sound card is offline, after removing an offload usecase from the usecase list, start traversing from the beginning of the list on the next iteration. This must be done because in the process of removing the current node from the list, there is a moment in the time where another thread can remove the node immediately after it which is also pointed to by tempnode that is used by list_for_each_safe. This would result in tempnode pointing to invalid memory on the next iteration of list_for_each_safe, causing a segfault. CRs-Fixed: 1088561 Change-Id: I8a220afa341c4e62612a809064754ddcd497d88a
Diffstat (limited to 'hal')
-rw-r--r--hal/audio_hw.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 1ea67542..40aea9af 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -4308,6 +4308,7 @@ static void close_compress_sessions(struct audio_device *adev)
pthread_mutex_unlock(&adev->lock);
out_standby(&out->stream.common);
pthread_mutex_lock(&adev->lock);
+ tempnode = list_head(&adev->usecase_list);
}
}
}