Merge "dsp: codecs: fix range check for audio buffer copying"

This commit is contained in:
Linux Build Service Account 2019-03-11 05:47:59 -07:00 committed by Gerrit - the friendly Code Review server
commit 0bc8b59292

View file

@ -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;