summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMisael Lopez Cruz <misael.lopez@ti.com>2011-05-31 09:23:16 +0100
committerAndy Green <andy.green@linaro.org>2011-05-31 11:04:44 +0100
commit5ac695688903ebbfa29e0ce947bfb0d6f7bb622e (patch)
treec598c6fd5576b176730f65a3f3eb069dcab8873f /sound
parent49c118d819b861cf31173a28b384dd63c04c6986 (diff)
ASoC: McPDM: Fix race condition in playback stream shutdown
In order to safely free McPDM interface during playback stream shutdown, it's also required to check that no new playback streams have been opened since the time the delayed shutdown work was scheduled and the time it got executed. Otherwise, McPDM interface could get freed between stream startup and hw_params calls, which could end up crashing the system. Change-Id: I50d5ce897b5f4684a7afe3723eb1dd90de65dacd Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/omap/omap-mcpdm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index 0dba7f0dc12..f2e6ac36f4c 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -741,7 +741,7 @@ static void playback_abe_work(struct work_struct *work)
}
mutex_unlock(&mcpdm->mutex);
- if (!mcpdm->free && !mcpdm->ul_active)
+ if (!mcpdm->free && !mcpdm->ul_active && !mcpdm->dl_active)
omap_mcpdm_free(mcpdm);
}