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

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

Merge "dsp: check ac before access the service id"

parents db1a1984 f24bc1f9
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -11000,14 +11000,23 @@ EXPORT_SYMBOL(q6asm_get_path_delay);

int q6asm_get_apr_service_id(int session_id)
{
	int service_id;

	pr_debug("%s:\n", __func__);

	if (session_id <= 0 || session_id > ASM_ACTIVE_STREAMS_ALLOWED) {
		pr_err("%s: invalid session_id = %d\n", __func__, session_id);
		return -EINVAL;
	}

	return ((struct apr_svc *)(session[session_id].ac)->apr)->id;
	mutex_lock(&session[session_id].mutex_lock_per_session);
	if (session[session_id].ac != NULL)
		if ((session[session_id].ac)->apr != NULL) {
			service_id = ((struct apr_svc *)(session[session_id].ac)->apr)->id;
			mutex_unlock(&session[session_id].mutex_lock_per_session);
			return service_id;
	}
	mutex_unlock(&session[session_id].mutex_lock_per_session);
	return -EINVAL;
}

uint8_t q6asm_get_asm_stream_id(int session_id)