Message ID | 20210201093128.1226603-1-kai.vehmanen@linux.intel.com |
---|---|
State | New |
Headers | show |
Series | ASoC: SOF: topology: Prevent NULL pointer dereference with no TLV | expand |
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index b69f493b5faa..46089000524d 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -1073,7 +1073,7 @@ static int sof_control_load_volume(struct snd_soc_component *scomp, scontrol->cmd = SOF_CTRL_CMD_VOLUME; /* extract tlv data */ - if (get_tlv_data(kc->tlv.p, tlv) < 0) { + if (!kc->tlv.p || get_tlv_data(kc->tlv.p, tlv) < 0) { dev_err(scomp->dev, "error: invalid TLV data\n"); ret = -EINVAL; goto out_free;