linux/drivers/devfreq
Ezequiel Garcia 6938a9da7f PM / devfreq: Fix kernel oops on governor module load
commit 7544fd7f38 upstream.

A bit unexpectedly (but still documented), request_module may
return a positive value, in case of a modprobe error.
This is currently causing issues in the devfreq framework.

When a request_module exits with a positive value, we currently
return that via ERR_PTR. However, because the value is positive,
it's not a ERR_VALUE proper, and is therefore treated as a
valid struct devfreq_governor pointer, leading to a kernel oops.

Fix this by returning -EINVAL if request_module returns a positive
value.

Fixes: b53b012805 ("PM / devfreq: Fix static checker warning in try_then_request_governor")
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-01 09:17:46 +01:00
..
event
devfreq-event.c
devfreq.c PM / devfreq: Fix kernel oops on governor module load 2019-12-01 09:17:46 +01:00
exynos-bus.c
governor_passive.c PM / devfreq: passive: fix compiler warning 2019-10-05 13:09:59 +02:00
governor_performance.c
governor_powersave.c
governor_simpleondemand.c
governor_userspace.c
governor.h
Kconfig
Makefile
rk3399_dmc.c
tegra-devfreq.c PM / devfreq: tegra: Fix kHz to Hz conversion 2019-10-11 18:20:46 +02:00