From: Matthias Kaehlcke <mka@chromium.org>
To: Leonard Crestez <leonard.crestez@nxp.com>
Cc: "Artur Świgoń" <a.swigon@partner.samsung.com>,
linux-pm@vger.kernel.org, "Krzysztof Kozlowski" <krzk@kernel.org>,
"Lukasz Luba" <l.luba@partner.samsung.com>,
"Chanwoo Choi" <cw00.choi@samsung.com>,
"Kyungmin Park" <kyungmin.park@samsung.com>,
"MyungJoo Ham" <myungjoo.ham@samsung.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] PM / devfreq: Check NULL governor in available_governors_show
Date: Mon, 23 Sep 2019 11:50:47 -0700 [thread overview]
Message-ID: <20190923185047.GC133864@google.com> (raw)
In-Reply-To: <96f459015e6418cee4fa20fdbdb80c4caf417c19.1569256298.git.leonard.crestez@nxp.com>
On Mon, Sep 23, 2019 at 07:34:43PM +0300, Leonard Crestez wrote:
> The governor is initialized after sysfs attributes become visible so in
> theory the governor field can be NULL here.
>
> Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
> ---
> drivers/devfreq/devfreq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Found this by hacking device core to call attribute "show" functions
> from inside device_add.
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 00fc23fea5b2..896fb2312f2f 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -1322,11 +1322,11 @@ static ssize_t available_governors_show(struct device *d,
>
> /*
> * The devfreq with immutable governor (e.g., passive) shows
> * only own governor.
> */
> - if (df->governor->immutable) {
> + if (df->governor && df->governor->immutable) {
> count = scnprintf(&buf[count], DEVFREQ_NAME_LEN,
> "%s ", df->governor_name);
> /*
> * The devfreq device shows the registered governor except for
> * immutable governors such as passive governor .
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-09-23 18:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20190923163453epcas4p1f9cff7d9f1a33fabcf4c980560d6c27d@epcas4p1.samsung.com>
2019-09-23 16:34 ` [PATCH] PM / devfreq: Check NULL governor in available_governors_show Leonard Crestez
2019-09-23 18:50 ` Matthias Kaehlcke [this message]
2019-09-24 1:52 ` Chanwoo Choi
2019-09-24 7:17 ` Leonard Crestez
2019-09-24 7:25 ` Chanwoo Choi
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=20190923185047.GC133864@google.com \
--to=mka@chromium.org \
--cc=a.swigon@partner.samsung.com \
--cc=cw00.choi@samsung.com \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=l.luba@partner.samsung.com \
--cc=leonard.crestez@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
/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;
as well as URLs for NNTP newsgroup(s).