mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-10-31 18:09:19 +00:00
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 <smanag@codeaurora.org>
This commit is contained in:
parent
e02c7a7eed
commit
7f45834835
1 changed files with 2 additions and 2 deletions
|
@ -160,7 +160,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 {
|
||||
|
@ -217,7 +217,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 {
|
||||
|
|
Loading…
Reference in a new issue