public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] opp: core: add regulators enable and disable
@ 2020-05-19 12:02 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-05-19 12:02 UTC (permalink / raw)
  To: k.konieczny; +Cc: linux-pm

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-19 12:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-19 12:02 [bug report] opp: core: add regulators enable and disable Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox