]> www.infradead.org Git - users/hch/misc.git/commitdiff
ASoC: qcom: audioreach: fix potential null pointer dereference
authorSrinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Mon, 25 Aug 2025 10:12:45 +0000 (11:12 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 1 Sep 2025 17:55:15 +0000 (18:55 +0100)
It is possible that the topology parsing function
audioreach_widget_load_module_common() could return NULL or an error
pointer. Add missing NULL check so that we do not dereference it.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Stable@vger.kernel.org
Fixes: 36ad9bf1d93d ("ASoC: qdsp6: audioreach: add topology support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20250825101247.152619-2-srinivas.kandagatla@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/qdsp6/topology.c

index ec51fabd98cb876bfb50230039b6183ebda4cb9f..c2226ed5164f761a4f90d65562fc4e4af5db4a4f 100644 (file)
@@ -607,8 +607,8 @@ static int audioreach_widget_load_module_common(struct snd_soc_component *compon
                return PTR_ERR(cont);
 
        mod = audioreach_parse_common_tokens(apm, cont, &tplg_w->priv, w);
-       if (IS_ERR(mod))
-               return PTR_ERR(mod);
+       if (IS_ERR_OR_NULL(mod))
+               return mod ? PTR_ERR(mod) : -ENODEV;
 
        mod->data = audioreach_get_module_priv_data(&tplg_w->priv);