Linux Power Management development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Cc: linux-pm@vger.kernel.org
Subject: [bug report] cpufreq: mediatek-hw: Add support for MT8196
Date: Tue, 19 Aug 2025 10:57:33 +0300	[thread overview]
Message-ID: <aKQubSEXH1TXQpnR@stanley.mountain> (raw)

Hello Nicolas Frattaroli,

Commit 32e0d669f3ac ("cpufreq: mediatek-hw: Add support for MT8196")
from Jul 16, 2025 (linux-next), leads to the following Smatch static
checker warning:

	drivers/cpufreq/mediatek-cpufreq-hw.c:76 mtk_cpufreq_hw_mt8196_init()
	warn: passing zero to 'PTR_ERR'

drivers/cpufreq/mediatek-cpufreq-hw.c
    72 static int mtk_cpufreq_hw_mt8196_init(struct mtk_cpufreq_priv *priv)
    73 {
    74         priv->fdvfs = devm_of_iomap(priv->dev, priv->dev->of_node, 0, NULL);
    75         if (IS_ERR_OR_NULL(priv->fdvfs))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
devm_of_iomap() can't return NULL.

--> 76                 return dev_err_probe(priv->dev, PTR_ERR(priv->fdvfs),

Passing a zero to to dev_err_probe() is a bug.  See my blog for more
details:
https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/

    77                                      "failed to get fdvfs iomem\n");
    78 
    79         return 0;
    80 }

regards,
dan carpenter

                 reply	other threads:[~2025-08-19  7:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=aKQubSEXH1TXQpnR@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nicolas.frattaroli@collabora.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