linux-stable/drivers/devfreq
Gustavo A. R. Silva 715f7e3efe PM / devfreq: Fix potential NULL pointer dereference in governor_store
[ Upstream commit 63f1e05f7f ]

df->governor is being dereferenced before it is null checked,
hence there is a potential null pointer dereference.

Notice that df->governor is being null checked at line 1004:
if (df->governor) {, which implies it might be null.

Fix this by null checking df->governor before dereferencing it.

Addresses-Coverity-ID: 1401988 ("Dereference before null check")
Fixes: bcf23c79c4 ("PM / devfreq: Fix available_governor sysfs")
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-13 19:48:09 +02:00
..
event PM / devfreq: exynos-nocp: Remove redundant code 2016-10-10 23:56:22 +02:00
devfreq-event.c PM / devfreq: make devfreq-event explicitly non-modular 2016-07-06 13:11:22 +09:00
devfreq.c PM / devfreq: Fix potential NULL pointer dereference in governor_store 2018-04-13 19:48:09 +02:00
exynos-bus.c PM / devfreq: exynos-bus: Fix the wrong return value 2017-01-26 08:24:44 +01:00
governor.h PM / devfreq: Fix wrong trans_stat of passive devfreq device 2017-03-12 06:41:44 +01:00
governor_passive.c PM / devfreq: Fix wrong trans_stat of passive devfreq device 2017-03-12 06:41:44 +01:00
governor_performance.c PM / devfreq: governors: add GPL module license and allow module build 2012-11-20 18:46:23 +09:00
governor_powersave.c PM / devfreq: governors: add GPL module license and allow module build 2012-11-20 18:46:23 +09:00
governor_simpleondemand.c PM / devfreq: cache the last call to get_dev_status() 2015-09-11 14:23:28 +09:00
governor_userspace.c PM / devfreq: governors: add GPL module license and allow module build 2012-11-20 18:46:23 +09:00
Kconfig PM / devfreq: rockchip: add PM_DEVFREQ_EVENT dependency 2016-09-19 13:12:17 +02:00
Makefile PM / devfreq: rockchip: add devfreq driver for rk3399 dmc 2016-09-06 13:26:34 +09:00
rk3399_dmc.c PM / devfreq: rk3399_dmc: Remove explictly regulator_put call in .remove 2016-09-19 13:36:20 +02:00
tegra-devfreq.c PM / devfreq: tegra: Set freq in rate callback 2016-02-23 14:27:42 +09:00