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

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

Merge "ASoC: msm-compress: Add NULL check in msm_compr_set_volume"

parents 723a62be 424a92eb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -381,12 +381,16 @@ static int msm_compr_set_volume(struct snd_compr_stream *cstream,
	}

	pdata = snd_soc_component_get_drvdata(component);
	if (!pdata)
		return -EINVAL;

	if (prtd->compr_passthr != LEGACY_PCM) {
		pr_debug("%s: No volume config for passthrough %d\n",
			 __func__, prtd->compr_passthr);
		return rc;
	}
	if (!rtd->dai_link || !pdata->ch_map[rtd->dai_link->id])
		return -EINVAL;

	use_default = !(pdata->ch_map[rtd->dai_link->id]->set_ch_map);
	chmap = pdata->ch_map[rtd->dai_link->id]->channel_map;