summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorXiaoyu Ye <benyxy@codeaurora.org>2019-03-03 21:14:10 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2019-03-11 00:39:42 -0700
commit9ab453c8c302b5a95edee88dbcf06cf79b176037 (patch)
treeffad6a1a4854b36713270c674330a839fd04990f /drivers
parent255838278aa37c3900fe9be96c0bb2fb6a9106a9 (diff)
dsp: codecs: fix range check for audio buffer copying
The range checking for audio buffer copying in function "audio_in_write" is using the incorrect buffer size. Change it to the actual allocated audio buffer size. Change-Id: Ib7aaa2163c0d99161369eb85d09dc2d23d8c787b Signed-off-by: Xiaoyu Ye <benyxy@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/qcom/qdsp6v2/audio_utils.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/misc/qcom/qdsp6v2/audio_utils.c b/drivers/misc/qcom/qdsp6v2/audio_utils.c
index 15d82d126df7..af95daef6503 100644
--- a/drivers/misc/qcom/qdsp6v2/audio_utils.c
+++ b/drivers/misc/qcom/qdsp6v2/audio_utils.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2010-2016, 2019 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -879,8 +879,7 @@ ssize_t audio_in_write(struct file *file,
__func__, audio->ac->session);
}
}
- xfer = (count > (audio->pcm_cfg.buffer_size)) ?
- (audio->pcm_cfg.buffer_size) : count;
+ xfer = (count > size) ? size : count;
if (copy_from_user(cpy_ptr, buf, xfer)) {
rc = -EFAULT;