public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: johnson.wang@mediatek.com
Cc: linux-pm@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: [bug report] PM / devfreq: mediatek: Introduce MediaTek CCI devfreq driver
Date: Mon, 13 Jun 2022 14:13:28 +0300	[thread overview]
Message-ID: <Yqcb2LyvqF/qRUsU@kili> (raw)

Hello Johnson Wang,

This is a semi-automatic email about new static checker warnings.

The patch 9f3ec0f65421: "PM / devfreq: mediatek: Introduce MediaTek 
CCI devfreq driver" from Jun 7, 2022, leads to the following Smatch 
complaint:

    drivers/devfreq/mtk-cci-devfreq.c:135 mtk_ccifreq_target()
    warn: variable dereferenced before check 'drv' (see line 130)

drivers/devfreq/mtk-cci-devfreq.c
   129		struct mtk_ccifreq_drv *drv = dev_get_drvdata(dev);
   130		struct clk *cci_pll = clk_get_parent(drv->cci_clk);
                                                     ^^^^^^^^^^^^
Dereference

   131		struct dev_pm_opp *opp;
   132		unsigned long opp_rate;
   133		int voltage, pre_voltage, inter_voltage, target_voltage, ret;
   134	
   135		if (!drv)
                    ^^^^
Checked too late.

   136			return -EINVAL;
   137	

regards,
dan carpenter

                 reply	other threads:[~2022-06-13 12:56 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=Yqcb2LyvqF/qRUsU@kili \
    --to=dan.carpenter@oracle.com \
    --cc=johnson.wang@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    /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