ASoC: msm: Validate pcm buffer size

Check if pcm samples to be copied is greater than
the kernel buffer size.

Change-Id: Ieddd3a3299640ebea0225985d13952045d5dc5c9
CRs-fixed: 813448
Signed-off-by: Kuirong Wang <kuirongw@codeaurora.org>
This commit is contained in:
Kuirong Wang 2015-03-26 09:17:29 -07:00 committed by Artem Borisov
parent ba9db7d517
commit eb02886309

View file

@ -445,6 +445,9 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a,
}
data = q6asm_is_cpu_buf_avail(IN, prtd->audio_client, &size, &idx);
if (fbytes > size)
fbytes = size;
bufptr = data;
if (bufptr) {
pr_debug("%s:fbytes =%d: xfer=%d size=%d\n",