mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 21:54:34 -04:00
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>
This commit is contained in:
parent
1a53e0ded7
commit
f47869b550
1 changed files with 1 additions and 1 deletions
|
|
@ -1336,7 +1336,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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue