summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>2025-08-25 11:12:45 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-06 11:20:06 +0200
commitef08ce6304d30b5778035d07b04514cb70839983 (patch)
tree5d2baf0d09626f47b67c8df358ae9f6bd8c7961f
parent4eeafff163e80d576c5efc1360ae310c0ceedd02 (diff)
downloadlinux-ef08ce6304d30b5778035d07b04514cb70839983.tar.gz
linux-ef08ce6304d30b5778035d07b04514cb70839983.tar.bz2
linux-ef08ce6304d30b5778035d07b04514cb70839983.zip
ASoC: qcom: audioreach: fix potential null pointer dereference
commit 8318e04ab2526b155773313b66a1542476ce1106 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/soc/qcom/qdsp6/topology.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/qcom/qdsp6/topology.c b/sound/soc/qcom/qdsp6/topology.c
index 83319a928f29..01bb1bdee5ce 100644
--- a/sound/soc/qcom/qdsp6/topology.c
+++ b/sound/soc/qcom/qdsp6/topology.c
@@ -587,8 +587,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;
dobj = &w->dobj;
dobj->private = mod;