mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
Merge "dsp: codecs: fix range check for audio buffer copying"
This commit is contained in:
commit
c38af66a58
1 changed files with 2 additions and 3 deletions
|
|
@ -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 @@ 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;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue