public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] PM / devfreq: Remove redundant governor_name from struct devfreq
@ 2021-07-07 14:37 Dan Carpenter
  2021-07-07 14:46 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-07-07 14:37 UTC (permalink / raw)
  To: cw00.choi; +Cc: linux-pm

[ It's so weird that I never reported this and also that no one else
  seems to have fixed it... ]

Hello Chanwoo Choi,

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

The patch 96ffcdf239de: "PM / devfreq: Remove redundant governor_name
from struct devfreq" from Oct 20, 2020, leads to the following Smatch
complaint:

    drivers/devfreq/devfreq.c:1272 devfreq_add_governor()
    warn: variable dereferenced before check 'devfreq->governor' (see line 1269)

drivers/devfreq/devfreq.c
  1268	
  1269			if (!strncmp(devfreq->governor->name, governor->name,
                                     ^^^^^^^^^^^^^^^^^^^^^^^^
Dereference

  1270				     DEVFREQ_NAME_LEN)) {
  1271				/* The following should never occur */
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
What?!?

  1272				if (devfreq->governor) {
                                    ^^^^^^^^^^^^^^^^^
Checked too late.

  1273					dev_warn(dev,
  1274						 "%s: Governor %s already present\n",

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] PM / devfreq: Remove redundant governor_name from struct devfreq
  2021-07-07 14:37 [bug report] PM / devfreq: Remove redundant governor_name from struct devfreq Dan Carpenter
@ 2021-07-07 14:46 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2021-07-07 14:46 UTC (permalink / raw)
  To: cw00.choi; +Cc: linux-pm

Same thing in the remove function as well.

    drivers/devfreq/devfreq.c:1334 devfreq_remove_governor()
    warn: variable dereferenced before check 'devfreq->governor' (see line 1331)

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-07 14:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-07 14:37 [bug report] PM / devfreq: Remove redundant governor_name from struct devfreq Dan Carpenter
2021-07-07 14:46 ` Dan Carpenter

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