mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
Merge "asoc: Update copy_to_user to requested buffer size"
This commit is contained in:
commit
a3ea69b6e4
1 changed files with 5 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -1017,7 +1017,10 @@ static int msm_pcm_capture_copy(struct snd_pcm_substream *substream,
|
|||
pr_debug("Offset value = %d\n", offset);
|
||||
if (size == 0 || size < prtd->pcm_count) {
|
||||
memset(bufptr + offset + size, 0, prtd->pcm_count - size);
|
||||
size = xfer = prtd->pcm_count;
|
||||
if (fbytes > prtd->pcm_count)
|
||||
size = xfer = prtd->pcm_count;
|
||||
else
|
||||
size = xfer = fbytes;
|
||||
}
|
||||
|
||||
if (copy_to_user(buf, bufptr+offset, xfer)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue