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

Commit c38af66a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 572dec3f 6c0100f2
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
// 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;