mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
ASoC: qcom: qdsp6: topology: check widget type before accessing data
Check widget type before accessing the private data, as this could a
virtual widget which is no associated with a dsp graph, container and
module. Accessing witout check could lead to incorrect memory access.
Fixes: 36ad9bf1d9 ("ASoC: qdsp6: audioreach: add topology support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260402081118.348071-4-srinivas.kandagatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -952,9 +952,6 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp,
|
||||
struct audioreach_container *cont;
|
||||
struct audioreach_module *mod;
|
||||
|
||||
mod = dobj->private;
|
||||
cont = mod->container;
|
||||
|
||||
if (w->id == snd_soc_dapm_mixer) {
|
||||
/* virtual widget */
|
||||
struct snd_ar_control *scontrol = dobj->private;
|
||||
@@ -963,6 +960,11 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp,
|
||||
kfree(scontrol);
|
||||
return 0;
|
||||
}
|
||||
mod = dobj->private;
|
||||
if (!mod)
|
||||
return 0;
|
||||
|
||||
cont = mod->container;
|
||||
|
||||
mutex_lock(&apm->lock);
|
||||
idr_remove(&apm->modules_idr, mod->instance_id);
|
||||
|
||||
Reference in New Issue
Block a user