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

Commit 4c120ebd authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: msm-pcm-host-voice: Handle OOB access in hpcm_start"

parents ed7a80c3 d9be8f44
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2013-2018, 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
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/init.h>
@@ -632,6 +625,12 @@ static int hpcm_start_vocpcm(char *pcm_id, struct hpcm_drv *prtd,
		}
	}

	if (*no_of_tp != no_of_tp_req && *no_of_tp > 2) {
		pr_err("%s:: Invalid hpcm start request\n", __func__);
		memset(&prtd->start_cmd, 0, sizeof(struct start_cmd));
		return -EINVAL;
	}

	if ((prtd->mixer_conf.tx.enable || prtd->mixer_conf.rx.enable) &&
	    *no_of_tp == no_of_tp_req) {
		voc_send_cvp_start_vocpcm(voc_get_session_id(sess_name),