summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShalini Manjunatha <quic_c_shalma@quicinc.com>2023-05-16 16:57:11 +0530
committerAlexander Grund <flamefire89@gmail.com>2023-12-23 19:58:21 +0100
commit003f2026ba356ff7985c2e543bbfbd210e2215c7 (patch)
treef0d69867bcef58a6644b2151e538db254de861f3
parent3f326631f769f46ad0e215e6f4683c805ea61ef9 (diff)
ASoC: msm-pcm-q6-v2: Add dsp buf check
Fix is to add check for this ADSP returned buf offset + size, if it is within the available buf size range Change-Id: I400cc4f5c07164f0a9b405ebea144ea0ae4b6cf2 Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
-rw-r--r--sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c
index 33a104c20bd1..00690c6817b9 100644
--- a/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c
+++ b/sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c
@@ -1004,7 +1004,7 @@ static int msm_pcm_capture_copy(struct snd_pcm_substream *substream,
goto fail;
}
- if (size == 0 || size < prtd->pcm_count) {
+ if ((size == 0 || size < prtd->pcm_count) && ((offset + size) < prtd->pcm_count)) {
memset(bufptr + offset + size, 0, prtd->pcm_count - size);
if (fbytes > prtd->pcm_count)
size = xfer = prtd->pcm_count;