ASoC: msm: audio-effects: misc fixes in h/w accelerated

effect

Adding memory copy size check and integer overflow check in h/w
accelerated effect driver.

Change-Id: I17d4cc0a38770f0c5067fa8047cd63e7bf085e48
CRs-Fixed: 1006609
Signed-off-by: Weiyin Jiang <wjiang@codeaurora.org>
This commit is contained in:
Weiyin Jiang 2016-04-26 14:35:38 +08:00 committed by Simon Shields
parent f6c251ef75
commit 1301ad430e

View file

@ -725,6 +725,12 @@ int q6asm_audio_client_buf_alloc_contiguous(unsigned int dir,
ac->port[dir].buf = buf;
if ((bufcnt > 0) && ((INT_MAX / bufcnt) < bufsz)) {
pr_err("%s: integer overflow", __func__);
mutex_unlock(&ac->cmd_lock);
goto fail;
}
buf[0].client = msm_ion_client_create(UINT_MAX, "audio_client");
if (IS_ERR_OR_NULL((void *)buf[0].client)) {
pr_err("%s: ION create client for AUDIO failed\n", __func__);