Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac57e160 authored by Leonard Crestez's avatar Leonard Crestez Committed by Greg Kroah-Hartman
Browse files

PM / devfreq: Check NULL governor in available_governors_show



commit d68adc8f85cd757bd33c8d7b2660ad6f16f7f3dc upstream.

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: default avatarLeonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Reviewed-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 062ec830
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1086,7 +1086,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);
	/*