mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-17 01:04:19 +08:00
ASoC: SOF: topology: Prevent NULL pointer dereference with no TLV
When there is no TLV data in topology, extracting the TLV data could result in a NULL pointer exception. Prevent this by making sure that the TLV data exists before extracting it. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com> Reviewed-by: Bard Liao <bard.liao@intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20210201093128.1226603-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
0084364d96
commit
941d3f0d7e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user