summaryrefslogtreecommitdiffstats
path: root/drivers/devfreq/devfreq.c
diff options
context:
space:
mode:
authorLeonard Crestez <leonard.crestez@nxp.com>2019-09-24 09:26:53 +0200
committerChanwoo Choi <cw00.choi@samsung.com>2019-11-06 04:03:59 +0100
commitd68adc8f85cd757bd33c8d7b2660ad6f16f7f3dc (patch)
treea6e3df4b4769af757083cda3a3e2fc9b79598b56 /drivers/devfreq/devfreq.c
parentdt-bindings: devfreq: exynos-bus: Remove unused property (diff)
downloadlinux-d68adc8f85cd757bd33c8d7b2660ad6f16f7f3dc.tar.xz
linux-d68adc8f85cd757bd33c8d7b2660ad6f16f7f3dc.zip
PM / devfreq: Check NULL governor in available_governors_show
The governor is initialized after sysfs attributes become visible so in theory the governor field can be NULL here. Fixes: bcf23c79c4e46 ("PM / devfreq: Fix available_governor sysfs") Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/devfreq/devfreq.c')
-rw-r--r--drivers/devfreq/devfreq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index b905963cea7d..60859a2400bc 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -1195,7 +1195,7 @@ 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);
/*