From: Dan Carpenter <dan.carpenter@oracle.com>
To: k.konieczny@samsung.com
Cc: linux-pm@vger.kernel.org
Subject: [bug report] opp: core: add regulators enable and disable
Date: Tue, 19 May 2020 15:02:31 +0300 [thread overview]
Message-ID: <20200519120231.GB42765@mwanda> (raw)
Hello Kamil Konieczny,
This is a semi-automatic email about new static checker warnings.
The patch f4111e2e1ae1: "opp: core: add regulators enable and
disable" from Jul 19, 2019, leads to the following Smatch complaint:
drivers/opp/core.c:846 dev_pm_opp_set_rate()
error: we previously assumed 'opp_table->regulators' could be null (see line 840)
drivers/opp/core.c
839
840 if (!opp_table->required_opp_tables && !opp_table->regulators) {
^^
Should this && be ||?
841 dev_err(dev, "target frequency can't be 0\n");
^^^^^^^^^^^^^^^^^^^^^^^^^^^
This error message is confusing.
842 ret = -EINVAL;
843 }
844
845 if (opp_table->regulator_enabled) {
846 regulator_disable(opp_table->regulators[0]);
^^^^^^^^^^^^^^^^^^^^^
Unchecked dereference.
847 opp_table->regulator_enabled = false;
848 }
regards,
dan carpenter
reply other threads:[~2020-05-19 12:03 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=20200519120231.GB42765@mwanda \
--to=dan.carpenter@oracle.com \
--cc=k.konieczny@samsung.com \
--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