Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 126fb9ff authored by Shalini Manjunatha's avatar Shalini Manjunatha Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarShalini Manjunatha <quic_c_shalma@quicinc.com>
parent 3589efc7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1016,7 +1016,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;