1
0
Fork 0
remarkable-linux/drivers/devfreq
Gustavo A. R. Silva b72d39b1da 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-12 12:32:13 +02:00
..
event PM / devfreq: exynos-ppmu: Staticize event list 2017-06-12 10:12:07 +09:00
Kconfig PM / devfreq: Add dependency on PM_OPP 2017-08-28 10:23:57 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
devfreq-event.c PM / devfreq: Convert to using %pOF instead of full_name 2017-08-28 09:15:33 +09:00
devfreq.c PM / devfreq: Fix potential NULL pointer dereference in governor_store 2018-04-12 12:32:13 +02:00
exynos-bus.c Merge branch 'pm-devfreq' 2017-02-20 14:23:40 +01:00
governor.h PM / devfreq: Move private devfreq_update_stats() into devfreq 2017-08-28 10:22:27 +09:00
governor_passive.c Merge branch 'pm-devfreq' 2017-02-20 14:23:40 +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: constify attribute_group structures. 2017-07-06 10:17:24 +09:00
rk3399_dmc.c PM / devfreq: rk3399_dmc: fix error return code in rk3399_dmcfreq_probe() 2017-07-06 10:15:22 +09:00
tegra-devfreq.c PM / devfreq: tegra: fix error return code in tegra_devfreq_probe() 2017-07-06 10:16:17 +09:00