mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
PM / devfreq: Check NULL governor in available_governors_show
commitd68adc8f85upstream. The governor is initialized after sysfs attributes become visible so in theory the governor field can be NULL here. Fixes:bcf23c79c4("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
68f9032e77
commit
b110cf2b74
@@ -982,7 +982,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);
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user