提交 d68adc8f 编写于 作者: L Leonard Crestez 提交者: Chanwoo Choi

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: bcf23c79 ("PM / devfreq: Fix available_governor sysfs")
Signed-off-by: NLeonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: NMatthias Kaehlcke <mka@chromium.org>
Reviewed-by: NChanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
上级 36eba5de
......@@ -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);
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册