From 0c5f346bf7a7ea35c9132689b2af133d56bf6646 Mon Sep 17 00:00:00 2001 From: Vignesh Kulothungan Date: Wed, 22 May 2019 11:53:08 -0700 Subject: [PATCH] asoc: fix silence data during concurrent capture Remove static definition of size and index variables, which are unique to each capture session. Static defintion of index variable may incorrectly copy data from wrong memory offset. This might inject silence/clutter in data copied to audio HAL. CRs-Fixed: 2457887 Change-Id: I7b2f48d21545655ddaa13566ab4ea87a1cbd7424 Signed-off-by: Vignesh Kulothungan --- asoc/msm-pcm-q6-v2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asoc/msm-pcm-q6-v2.c b/asoc/msm-pcm-q6-v2.c index fc9b33209ee9..3b20ecc84570 100644 --- a/asoc/msm-pcm-q6-v2.c +++ b/asoc/msm-pcm-q6-v2.c @@ -950,8 +950,8 @@ static int msm_pcm_capture_copy(struct snd_pcm_substream *substream, int xfer; char *bufptr; void *data = NULL; - static uint32_t idx; - static uint32_t size; + uint32_t idx = 0; + uint32_t size = 0; uint32_t offset = 0; struct snd_pcm_runtime *runtime = substream->runtime; struct msm_audio *prtd = substream->runtime->private_data;