Skip to content

Commit ef3c539

Browse files
Srinivas KandagatlaRaviHothi
authored andcommitted
FROMLIST: 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. Link: https://lore.kernel.org/all/20260223180740.444311-4-srinivas.kandagatla@oss.qualcomm.com/ Fixes: 36ad9bf ("ASoC: qdsp6: audioreach: add topology support") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
1 parent 2338c03 commit ef3c539

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sound/soc/qcom/qdsp6/topology.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,9 +952,6 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp,
952952
struct audioreach_container *cont;
953953
struct audioreach_module *mod;
954954

955-
mod = dobj->private;
956-
cont = mod->container;
957-
958955
if (w->id == snd_soc_dapm_mixer) {
959956
/* virtual widget */
960957
struct snd_ar_control *scontrol = dobj->private;
@@ -963,6 +960,11 @@ static int audioreach_widget_unload(struct snd_soc_component *scomp,
963960
kfree(scontrol);
964961
return 0;
965962
}
963+
mod = dobj->private;
964+
if (!mod)
965+
return 0;
966+
967+
cont = mod->container;
966968

967969
mutex_lock(&apm->lock);
968970
idr_remove(&apm->modules_idr, mod->instance_id);

0 commit comments

Comments
 (0)