Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb026c53 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge a4374817 on remote branch

Change-Id: I8c23cb3b8ca5a55dd743ccda03c6a8c56e94882e
parents 3facd4cc a4374817
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */


@@ -1007,6 +1008,14 @@ static int msm_pcm_capture_copy(struct snd_pcm_substream *substream,
			xfer = size;
		offset = prtd->in_frame_info[idx].offset;
		pr_debug("Offset value = %d\n", offset);

		if (offset >= size) {
			pr_err("%s: Invalid dsp buf offset\n", __func__);
			ret = -EFAULT;
			q6asm_cpu_buf_release(OUT, prtd->audio_client);
			goto fail;
		}

		if (size == 0 || size < prtd->pcm_count) {
			memset(bufptr + offset + size, 0, prtd->pcm_count - size);
			if (fbytes > prtd->pcm_count)