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

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

Merge "ASoC: msm: qdsp6v2: fix null pointer access during SSR"

parents 4af12674 5b27ee0c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1447,6 +1447,7 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv)
	}

	if (data->opcode == RESET_EVENTS) {
		mutex_lock(&ac->cmd_lock);
		atomic_set(&ac->reset, 1);
		if (ac->apr == NULL)
			ac->apr = ac->apr2;
@@ -1462,6 +1463,7 @@ static int32_t q6asm_callback(struct apr_client_data *data, void *priv)
		atomic_set(&ac->cmd_state, 0);
		wake_up(&ac->time_wait);
		wake_up(&ac->cmd_wait);
		mutex_unlock(&ac->cmd_lock);
		return 0;
	}

@@ -1879,12 +1881,13 @@ static void __q6asm_add_hdr(struct audio_client *ac, struct apr_hdr *hdr,
{
	dev_vdbg(ac->dev, "%s: pkt_size=%d cmd_flg=%d session=%d stream_id=%d\n",
			__func__, pkt_size, cmd_flg, ac->session, stream_id);
	mutex_lock(&ac->cmd_lock);
	if (ac->apr == NULL) {
		pr_err("%s: AC APR handle NULL", __func__);
		mutex_unlock(&ac->cmd_lock);
		return;
	}

	mutex_lock(&ac->cmd_lock);
	hdr->hdr_field = APR_HDR_FIELD(APR_MSG_TYPE_SEQ_CMD, \
			APR_HDR_LEN(sizeof(struct apr_hdr)),\
			APR_PKT_VER);