From d57aca081251c30afad417fc01c09f7f02bc681c Mon Sep 17 00:00:00 2001 From: Xiaojun Sang Date: Wed, 6 Mar 2019 17:03:08 +0800 Subject: [PATCH] ASoC: initialize queue head for compress capture Waitqueue head is not initialized at open stage. Future action may wake up uninitialized wait. Initialize them for compress capture. Change-Id: I142202783aa9b7b9334c1a9632a89cd1ba7f5005 Signed-off-by: Xiaojun Sang --- asoc/msm-compress-q6-v2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/asoc/msm-compress-q6-v2.c b/asoc/msm-compress-q6-v2.c index 179a95e66f35..a7b9ff24ca8d 100644 --- a/asoc/msm-compress-q6-v2.c +++ b/asoc/msm-compress-q6-v2.c @@ -1779,6 +1779,11 @@ static int msm_compr_capture_open(struct snd_compr_stream *cstream) atomic_set(&prtd->wait_on_close, 0); atomic_set(&prtd->error, 0); + init_waitqueue_head(&prtd->eos_wait); + init_waitqueue_head(&prtd->drain_wait); + init_waitqueue_head(&prtd->close_wait); + init_waitqueue_head(&prtd->wait_for_stream_avail); + runtime->private_data = prtd; return 0;