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

Commit d25a9d92 authored by Soumya Managoli's avatar Soumya Managoli Committed by ssizon
Browse files

dsp: asm: Add range check for audio port index



Add range check to make sure the received
audio port index from ADSP is within the
valid range.

Change-Id: Ief647df1659f7f349a843f666d8f92f34a9a43be
Signed-off-by: default avatarSoumya Managoli <smanag@codeaurora.org>
parent 9d32bdba
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1774,6 +1774,13 @@ static int32_t q6asm_srvc_callback(struct apr_client_data *data, void *priv)
		return 0;
	}

	if (dir != IN && dir != OUT) {
		pr_err("%s: Invalid audio port index: %d\n", __func__, dir);
		if ((session_id > 0 && session_id <= SESSION_MAX))
			spin_unlock_irqrestore(
				&(session[session_id].session_lock), flags);
			return 0;
	}
	port = &ac->port[dir];

	switch (data->opcode) {