From 63f89715433a381a9c95cfb752a45c6852538216 Mon Sep 17 00:00:00 2001 From: Soumya Managoli Date: Fri, 27 Apr 2018 11:21:45 +0530 Subject: [PATCH] ASoC: msm: Modify buf size check to prevent OOB error Expected buffer size to read is 2 bytes. Corrected the size check to return error when count is not 2. Change-Id: I43b572d191f6f98a8a790b5ae77b43fabcd7329a Signed-off-by: Soumya Managoli --- sound/soc/msm/qdsp6v2/q6asm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/msm/qdsp6v2/q6asm.c b/sound/soc/msm/qdsp6v2/q6asm.c index e9592cf1eb5a..567534e1599d 100644 --- a/sound/soc/msm/qdsp6v2/q6asm.c +++ b/sound/soc/msm/qdsp6v2/q6asm.c @@ -339,7 +339,7 @@ static ssize_t audio_output_latency_dbgfs_write(struct file *file, { char *temp; - if (count > 2*sizeof(char)) { + if (count != 2*sizeof(char)) { pr_err("%s: err count is more %zd\n", __func__, count); return -EINVAL; } else { @@ -396,7 +396,7 @@ static ssize_t audio_input_latency_dbgfs_write(struct file *file, { char *temp; - if (count > 2*sizeof(char)) { + if (count != 2*sizeof(char)) { pr_err("%s: err count is more %zd\n", __func__, count); return -EINVAL; } else {