public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: cw00.choi@samsung.com
Cc: linux-pm@vger.kernel.org
Subject: [bug report] PM / devfreq: Remove redundant governor_name from struct devfreq
Date: Wed, 7 Jul 2021 17:37:45 +0300	[thread overview]
Message-ID: <YOW8OfCxLDXe1XdF@mwanda> (raw)

[ 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

             reply	other threads:[~2021-07-07 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07 14:37 Dan Carpenter [this message]
2021-07-07 14:46 ` [bug report] PM / devfreq: Remove redundant governor_name from struct devfreq Dan Carpenter

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=YOW8OfCxLDXe1XdF@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=cw00.choi@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