Merge "dsp: codecs: fix range check for audio buffer copying"
diff --git a/dsp/codecs/audio_utils.c b/dsp/codecs/audio_utils.c
index 1c44fcc..26e9b0b 100644
--- a/dsp/codecs/audio_utils.c
+++ b/dsp/codecs/audio_utils.c
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
-/* Copyright (c) 2010-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2010-2019, The Linux Foundation. All rights reserved.
*/
#include <linux/module.h>
@@ -900,9 +900,8 @@
__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;
break;