linux-sound.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Cc: linux-sound@vger.kernel.org
Subject: [bug report] ASoC: qcom: audioreach: add support for static calibration
Date: Fri, 22 Aug 2025 11:07:52 +0300	[thread overview]
Message-ID: <aKglWJPzKWWXwp_b@stanley.mountain> (raw)

Hello Srinivas Kandagatla,

Commit c7ed4c2debfd ("ASoC: qcom: audioreach: add support for static
calibration") from Aug 19, 2025 (linux-next), leads to the following
Smatch static checker warning:

	sound/soc/qcom/qdsp6/topology.c:613 audioreach_widget_load_module_common()
	error: potential NULL/IS_ERR bug 'mod'

sound/soc/qcom/qdsp6/topology.c
    591 static int audioreach_widget_load_module_common(struct snd_soc_component *component,
    592                                                 int index, struct snd_soc_dapm_widget *w,
    593                                                 struct snd_soc_tplg_dapm_widget *tplg_w)
    594 {
    595         struct q6apm *apm = dev_get_drvdata(component->dev);
    596         struct audioreach_container *cont;
    597         struct audioreach_sub_graph *sg;
    598         struct audioreach_module *mod;
    599         struct snd_soc_dobj *dobj;
    600 
    601         sg = audioreach_parse_sg_tokens(apm, &tplg_w->priv);
    602         if (IS_ERR(sg))
    603                 return PTR_ERR(sg);
    604 
    605         cont = audioreach_parse_cont_tokens(apm, sg, &tplg_w->priv);
    606         if (IS_ERR(cont))
    607                 return PTR_ERR(cont);
    608 
    609         mod = audioreach_parse_common_tokens(apm, cont, &tplg_w->priv, w);
    610         if (IS_ERR(mod))
    611                 return PTR_ERR(mod);

The audioreach_parse_common_tokens() can return either error pointers or
NULL.

    612 
--> 613         mod->data = audioreach_get_module_priv_data(&tplg_w->priv);
                ^^^^^^^^^
Only checked for error pointers, and it could still be NULL

    614 
    615         dobj = &w->dobj;
    616         dobj->private = mod;
    617 
    618         return 0;
    619 }

regards,
dan carpenter

             reply	other threads:[~2025-08-22  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-22  8:07 Dan Carpenter [this message]
2025-08-22  8:40 ` [bug report] ASoC: qcom: audioreach: add support for static calibration Srinivas Kandagatla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aKglWJPzKWWXwp_b@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=srinivas.kandagatla@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).